CrashChicken
CrashChicken
DTDrizzle Team
Created by CrashChicken on 8/13/2024 in #help
Using default values removes columns from insert and update types
will probably ditch it in favor of hono if it causes too much issues
14 replies
DTDrizzle Team
Created by CrashChicken on 8/13/2024 in #help
Using default values removes columns from insert and update types
yeah unfortunately nestjs and some of its packages have problems in this mode and thats why they dont turn this on by default
14 replies
DTDrizzle Team
Created by CrashChicken on 8/13/2024 in #help
Using default values removes columns from insert and update types
omg, fixed it by enabling strictNullChecks as nestjs defaults it to false
14 replies
DTDrizzle Team
Created by CrashChicken on 8/13/2024 in #help
Using default values removes columns from insert and update types
Created brand new nestjs project and it has the same problems, i guess i have to look into tsconfig.json
14 replies
DTDrizzle Team
Created by CrashChicken on 8/13/2024 in #help
Using default values removes columns from insert and update types
Hmmm, I tested this exact code in a nextjs project and it works prfectly. It seems that nestjs has some wierd ts behaviors?
type NewTest = {
defaultValue?: number | undefined;
nonDefaultValue?: number | null | undefined;
}
type NewTest = {
defaultValue?: number | undefined;
nonDefaultValue?: number | null | undefined;
}
14 replies
DTDrizzle Team
Created by CrashChicken on 8/13/2024 in #help
Using default values removes columns from insert and update types
and i'm using pgTable with pg (node-postgres)
14 replies
DTDrizzle Team
Created by CrashChicken on 8/13/2024 in #help
Using default values removes columns from insert and update types
If I have notNull on both columns its:
type Test = {
defaultValue: number;
nonDefaultValue: number;
}
type Test = {
defaultValue: number;
nonDefaultValue: number;
}
type NewTest = {
nonDefaultValue: number;
}
type NewTest = {
nonDefaultValue: number;
}
But if I remove notNull on the nonDefaultValue column inferInsert is empty:
type NewTest = {}
type NewTest = {}
14 replies
DTDrizzle Team
Created by CrashChicken on 8/13/2024 in #help
Using default values removes columns from insert and update types
Also I'm using this inside a NestJS project if that is a factor and the latest drizzle-orm 0.33.0
14 replies