Skip to content

Commit

Permalink
fix: correctly type expression generated columns
Browse files Browse the repository at this point in the history
  • Loading branch information
rintaun committed Dec 10, 2022
1 parent 073cfad commit da792a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -32,15 +32,15 @@ export const TestGenerationDefaults$SelectSchema = z.object({
generated_id: z.number()
});
export const TestGenerationDefaults$InsertSchema = z.object({
generated_column: z.number(),
generated_column: z.number().optional().or(z.literal(DEFAULT)),
generated_id: z.number().optional().or(z.literal(DEFAULT))
});
export interface TestGenerationDefaults {
generated_column: number;
generated_id: number;
}
export interface TestGenerationDefaults$Insert {
generated_column: number;
generated_column?: number;
generated_id?: number;
}
export const TestGenerationDefaults$Types = {
Expand Down
3 changes: 2 additions & 1 deletion src/generator/database/SchemaInfo.ts
Expand Up @@ -49,7 +49,8 @@ export default class SchemaInfo {
, (c.is_nullable = 'YES') AS "nullable"
, (
c.column_default IS NOT NULL OR
c.identity_generation IS NOT NULL
c.identity_generation IS NOT NULL OR
c.is_generated != 'NEVER'
) AS "hasDefault"
, c.ordinal_position AS "order"
, COALESCE(
Expand Down

0 comments on commit da792a1

Please sign in to comment.