-
-
Notifications
You must be signed in to change notification settings - Fork 141
POC: typescript generator #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -62,7 +64,7 @@ | |||
"pkg": "^5.5.2", | |||
"rimraf": "^3.0.2", | |||
"ts-jest": "^27.0.5", | |||
"ts-node-dev": "^1.1.6", | |||
"ts-node-dev": "^2.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on node v16 now - needed to bump this
|
||
`.trim() | ||
|
||
export default template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main template, based on the spec in the RFC
const { data: tables } = await pgMeta.tables.list({}) | ||
const { data: functions } = await pgMeta.functions.list({}) | ||
const definition = ejs.render(template, { tables, functions }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pgMeta already has the data in JSON format, so we have done the hard work - we just need to pass the data to the template
const { data: functions } = await pgMeta.functions.list({}) | ||
const definition = ejs.render(template, { tables, functions }) | ||
|
||
return reply.header('content-type', responseFormat).send(definition) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need configurable responseFormat
? Or can we make it text/plain
always?
Closed in favor of #269 |
Draft/POC