[Bug?] Drizzle generates a broken query when passing an explicit value for a column as `undefined`

I've translated most of my logic from Prisma usage -> Drizzle. Noticed an issue where when explicitly passing attributes as undefined while inserting, drizzle generates a SQL query like:
sql .... SET exampleProperty = ,
sql .... SET exampleProperty = ,
which throws a syntax error during runtime
5 Replies
alexblokh
alexblokh16mo ago
hey, which dialect?
rushil1o1
rushil1o116mo ago
postgres Its a strange behavior because the attribute is nullable, so I'd assume drizzle to automatically understand that and just not include it in the SET query. FYI: further context, not including the attribute in the set() call works; explicitly setting it as undefined doesn't work -- throws the error above @alexblokh
bloberenober
bloberenober16mo ago
Sounds like a bug
rushil1o1
rushil1o116mo ago
appreciate it!!