-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Report hasn't been filed before.
- I have verified that the bug I'm about to report hasn't been filed before.
What version of drizzle-orm
are you using?
0.44.5
What version of drizzle-kit
are you using?
0.31.4
Other packages
No response
Describe the Bug
Bug Description
When running drizzle-kit introspect
on a PostgreSQL database, the command fails with:
Root Cause
The issue is in bin.cjs
around line 19554 where the code expects column names in uppercase but receives them in lowercase from the database.
Current problematic code:
const constraintName = checkConstraintRow["CONSTRAINT_NAME"];
const constraintValue = checkConstraintRow["CHECK_CLAUSE"];
const tableName = checkConstraintRow["TABLE_NAME"];
Working fix:
const constraintName = checkConstraintRow["CONSTRAINT_NAME"] ?? checkConstraintRow["constraint_name"];
const constraintValue = checkConstraintRow["CHECK_CLAUSE"] ?? checkConstraintRow["check_clause"];
const tableName = checkConstraintRow["TABLE_NAME"] ?? checkConstraintRow["table_name"];
Environment
- drizzle-kit version: 0.31.4
- Database: PostgreSQL (Supabase)
- OS: Windows 10
Steps to Reproduce
- Run
npx drizzle-kit introspect
on a PostgreSQL database with check constraints - The command fails when processing check constraints
Expected Behavior
The introspection should complete successfully and generate schema files.
Additional Notes
This appears to be a case sensitivity issue where different PostgreSQL configurations return column names in different cases.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working