© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago
jakeleventhal

How do default array values work?

Can't find any discord or GH posts about it. It's not in docs either. If you create an array column (postgres), will it automatically create a default value of
[]
[]
even if no default is specified? for instance
text('someField').array()
text('someField').array()
is it correct that this will not require me to specify
someField
someField
upon insertion and will automatically create an empty array for me?

related: i found this bug during introspection for empty array default values https://github.com/drizzle-team/drizzle-kit-mirror/issues/276
GitHub
[BUG]: Postgres introspect gives bugged value for default empty arr...
I have a text field with a default array value of []. When i run drizzle-kit introspect:pg The field gets copied in as text('myListField').default('RRAY[').array()
[BUG]: Postgres introspect gives bugged value for default empty arr...
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

How to do "onConflictDoUpdate" when inserting an array of values?
Drizzle TeamDTDrizzle Team / help
3y ago
Empty default array
Drizzle TeamDTDrizzle Team / help
2y ago
How do errors work?
Drizzle TeamDTDrizzle Team / help
2y ago
define default value for array
Drizzle TeamDTDrizzle Team / help
3y ago