We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8429509 commit f8bbfcaCopy full SHA for f8bbfca
src/server/templates/typescript.ts
@@ -271,14 +271,22 @@ export const apply = async ({
271
if (relation) {
272
return `{
273
${columnsByTableId[relation.id]
274
- .map(
275
- (column) =>
276
- `${JSON.stringify(column.name)}: ${pgTypeToTsType(schema, column.format, {
+ .map((column) =>
+ generateColumnTsDefinition(
+ schema,
277
+ {
278
+ name: column.name,
279
+ format: column.format,
280
+ is_nullable: column.is_nullable,
281
+ is_optional: false,
282
+ },
283
284
types,
285
schemas,
286
tables,
287
views,
- })} ${column.is_nullable ? '| null' : ''}`
288
+ }
289
+ )
290
)
291
.join(',\n')}
292
}`
0 commit comments