drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: sqlite: deferrable foreign key relations

Open
#2,252 3 comments 14 reactions 0 assignees View on GitHub
db/sqlite drizzle/kit enhancement
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Describe what you want

Would love to see support for [deferrable foreign key constraints](), maybe something like:

```js
latestGeneration: text("latestGenerationId")
.notNull()
.references(() => generation.id, {
deferrable: true,
initially: "immediate",
}),
```

Similar to #1429 but for sqlite and instead focuses on fk constraints instead of unique constraints.

afaik there's no workarounds for this rn as I don't think you can add in custom SQL to the end of a column definition, would love to be wrong though.

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.