© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
2 replies
sevenwestonroads

Wrong drizzle generate with an array of text() in PSQL

I've been trying to create an array of text() using PSQL for ex. when I add the below column, drizzle generates this

"custom_selected_rules" text[] DEFAULT NOT NULL
"custom_selected_rules" text[] DEFAULT NOT NULL


but here's the schema definition

customSelectedRules: text("custom_selected_rules")
      .array()
      .default([])
      .notNull()
customSelectedRules: text("custom_selected_rules")
      .array()
      .default([])
      .notNull()


It should be

"custom_selected_rules" text[] DEFAULT '{}'::text[] NOT NULL
"custom_selected_rules" text[] DEFAULT '{}'::text[] NOT NULL



Why Drizzle doesn't do this by default? Thanks!
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Psql Array of text and `createSelectSchema`, `createInsertSchema`
Drizzle TeamDTDrizzle Team / help
3y ago
drizzle generate with name
Drizzle TeamDTDrizzle Team / help
7mo ago
Drizzle/better-auth + Local PSQL
Drizzle TeamDTDrizzle Team / help
16mo ago
Issues with drizzle-kit generate
Drizzle TeamDTDrizzle Team / help
2y ago