Issue: INSERT automatically includes ALL schema columns, even when not provided in .values() Drizzle
Issue: INSERT automatically includes ALL schema columns, even when not provided in .values() Drizzle is including columns in INSERT statements that I'm not explicitly providing in .values(). For nullable columns, it automatically sets them to NULL, which causes errors when the column doesn't exist in the database.
INSERT INTO "users" ("id", "name", "email") VALUES (1, 'John', NULL)
INSERT INTO "users" ("id", "name", "email") VALUES (1, 'John', NULL)
Why This Matters: When you have multiple environments (dev, staging, production), your code and database schema don't always match across all environments at the same time.
I add email column to my TypeScript schema I deploy to dev → migration runs → column exists I deploy to staging → migration runs → column exists I deploy to production → migration hasn't run yet → column doesn't exist
The same code works in dev and staging but breaks in production because Drizzle includes the email column in the INSERT statement even though I never asked for it.
The root issue: Drizzle treats the TypeScript schema as the absolute source of truth and includes ALL nullable columns in INSERT statements (setting them to NULL), regardless of what I pass to .values().
What I expect: Only insert the columns I explicitly provide. If I don't include email in my .values() object, don't add it to the SQL INSERT statement.