drizzle-team / drizzle-team/drizzle-orm

[BUG]: Do not allow the chaining of json and unique with Postgres

Open
#1,623 0 comments 0 reactions 0 assignees View on GitHub
db/postgres enhancement
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### What version of `drizzle-orm` are you using?

0.29.1

### What version of `drizzle-kit` are you using?

_No response_

### Describe the Bug

As Postgres does not support the unique constraint for a `json` column (keys are not ordered), it should not be possible to chain `json()` and `unique()`. Note that `jsonb` supports this constraint as the object is serialized in a deterministic way.

### Expected behavior

`json` should be typed so it cannot be chained with `unique`.

### Environment & setup

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.