Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
24.61k
stars
649
forks
source link
[BUG]: postgres insert and generatedAlwaysAsIdentity tries to insert null value #3576
Open
ChxGuillaume opened 3 days ago
Report hasn't been filed before.
What version of
drizzle-orm
are you using?0.36.3
What version of
drizzle-kit
are you using?not installed
Other packages
No response
Describe the Bug
When using a model like this
and executing
The generated SQL will is
It's trying to set the ID to null just errors, thus making the insert impossible
[2024-11-18 22:43:29] [23502] ERROR: null value in column "id" of relation "materials" violates not-null constraint
I am pretty sure that the Primary Column shouldn't get an insert value
Note: I am using Postgres and tried with version 11 and 16 of postgres