Using default values removes columns from insert and update types
Using the above schema makes the following error when I try to override the
defaultValue
with 2
.
And if I remove the notNull
on the nonDefaultValue
I get no intelisense at all. I can input any object and typescript shows no errors.
I hope you can help me.
Thanks in advance!6 Replies
Also I'm using this inside a NestJS project if that is a factor and the latest drizzle-orm 0.33.0
interesting. what driver?
and what is the type generated by
typeof testSchema.$inferSelect
and typeof testSchema.$inferInsert
If I have
notNull
on both columns its:
But if I remove notNull
on the nonDefaultValue
column inferInsert
is empty:
and i'm using pgTable with pg (node-postgres)
Hmmm, I tested this exact code in a nextjs project and it works prfectly. It seems that nestjs has some wierd ts behaviors?
Created brand new nestjs project and it has the same problems, i guess i have to look into tsconfig.json
omg, fixed it by enabling strictNullChecks
as nestjs defaults it to false
ah yep that'll do it
in general, turn strict mode on
yeah unfortunately nestjs and some of its packages have problems in this mode and thats why they dont turn this on by default
will probably ditch it in favor of hono if it causes too much issues
ay found any solution,?