DT
Drizzle Team•9mo ago
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?
Drizzle ORM - Indexes & Constraints
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
No description
4 Replies
Woet
WoetOP•9mo ago
No description
alexblokh
alexblokh•9mo ago
cc: @Mykhailo
Mykhailo
Mykhailo•9mo ago
Hey @Woet! Could you show me your imports please?
Woet
WoetOP•9mo ago
Thanks for getting back to me on this @Mykhailo , I already found a way to fix the issue I was having. Already a couple of days ago, so I don't exactly remember what the solution was anymore, but seems to work now 🙂

Did you find this page helpful?