[BUG]: drizzle-kit generate
succeeds but generates invalid SQL for default([])
- Postgres
#2432
Labels
bug
Something isn't working
What version of
drizzle-orm
are you using?0.30.10
What version of
drizzle-kit
are you using?0.21.4
Describe the Bug
https://orm.drizzle.team/learn/guides/empty-array-default-value explains the right way to do this, but as someone new to Drizzle it was confusing that
drizzle-kit generate
acceptsdefault([])
but ends up generating invalid SQL.Schema before:
Schema after:
Run
drizzle-kit generate
- succeeds.Got SQL in migration file:
Run
drizzle-kit migrate
- postgres invalid syntax error.Expected behavior
Expected SQL in migration file:
OR it would be nice if
drizzle-kit generate
could return an error saying the schema is invalid, instead of succeeding. The type inference fordefault
says it accepts astring[] | SQL<unknown>
, so passing[]
seems intuitive.Environment & setup
Inside a devcontainer running the
mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm
Docker imageThe text was updated successfully, but these errors were encountered: