Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Is there a way to create a unique constrain on a jsonb column in a table? - Drizzle Team
DT
Drizzle Team
•
2y ago
•
11 replies
RickDom
Is there a way to create a unique constrain on a jsonb column in a table?
I have a table with a
"label
" column that is a jsonb column storing objects that look like this
:
{ "en": "Girl", "ja": "女性" }
{ "en": "Girl", "ja": "女性" }
. I would like to set up the unique constraint to ensure that each row is unique based on
label->>en
label->>en
at least
. Is this possible when defining the schema
? Or do I need to restort to brute forcing it in the SQL
?
I am using Drizzle ORM with node postrgesql
.
Drizzle Team
Join
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Is there a way to check/constrain a column?
DT
Drizzle Team / help
2y ago
How to create unique constraint on a column for a foreign key?
DT
Drizzle Team / help
3y ago
No way for TypeScript to infer if a column is unique
DT
Drizzle Team / help
12mo ago