Drizzle TeamDT
Drizzle Team2y ago
4 replies
Woet

Postgres - Unique constraint that allows null

I'm looking to have a unique constraint on a column, but it should allowed NULL.

I believe this should be supported according to this documentation page: https://orm.drizzle.team/docs/indexes-constraints#unique

But the example from the docs itself gives quite a bit of errors.

Anyone that could help me to see if I'm doing something wrong or is there a bug?
image.png
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Was this page helpful?