We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drizzle-orm
0.36.3
drizzle-kit
not installed
No response
When using a model like this
export const materials = pgTable("materials", { id: integer().primaryKey().generatedAlwaysAsIdentity(), name: varchar({ length: 255 }),] });
and executing
drizzleDb .insert(materials) .values({ name: "my name" }) .returning();
The generated SQL will is
INSERT INTO "materials" ("id", "name") VALUES (null, 'my name')
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
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: