GitShow/drizzle-team/drizzle-orm
drizzle-team

drizzle-orm

ORM

by drizzle-team
bunjsmysqlnodejsormpostgrespostgresqlsqlsqlite
Star on GitHubForkWebsitenpm

TypeScript

35.7k stars1.6k forks135 contributorsActive · 15h agoSince 20210.45.2Apache-2.0

Meet the team

See all 135 on GitHub →
AndriiSherman
AndriiSherman1.1k contributions
dankochetov
dankochetov837 contributions
L-Mario564
L-Mario564140 contributions
AlexBlokh
AlexBlokh128 contributions
Sukairo-02
Sukairo-02106 contributions
Angelelz
Angelelz100 contributions
AleksandrSherman
AleksandrSherman71 contributions
OleksiiKH0240
OleksiiKH024059 contributions

Languages

View on GitHub →
TypeScript98.7%
JavaScript1.3%

Commit activity

Last 12 weeks · 6 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
87
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · Last activity 15h ago
See all on GitHub →
domuk-k
[Pg] Release the pool client when BEGIN fails in pooled transactionsOpenPR

Fixes #6241 What changed in the , and sessions ran before the that releases the pool client. When threw (statement timeout, connection dropped right after connect, admin shutdown), never ran and the leaked — one client per failure until hung on an empty pool. This moves the statement inside the in all three sessions. That's the whole code change (3 lines). The existing still runs and rethrows. Outside a transaction is a WARNING, not an error. The error the caller gets is unchanged ( wrapping the driver error). Non-pooled clients never went through , so nothing changes for them. and don't acquire a pooled client and aren't touched. Tests — vitest, no database or Docker. It subclasses each driver's , overrides to return a fake client whose throws , and runs two cases per driver via : 1. fails → error propagates with , the callback never runs, the client is acquired once and released once. 2. Happy path → , , released once. Guards the normal flow. On case 1 fails for all three drivers ( is 0). With this change all 6 pass. is clean and has no errors. Changelog One line under a new "Bug fixes" heading in (the unreleased version on ). No version bump. Notes (1.0.0-rc.4) has the same three lines; happy to open the same change there if you want it ported. Found this while moving a service from raw to drizzle — the raw code had around , so every in the migration silently picked up the leak. This was created with the help of AI (Claude), reviewed and tested by me.

domuk-k · 13h ago
ks342
[Pg-kit] Exclude NOT VALID check constraints from Postgres introspectionOpenPR

Fixes #6214. was mangling any check constraint defined with NOT VALID. The introspector assumed the definition always looked like and pulled out the expression with a fixed slice, which works fine normally but chops the last letter off "NOT VALID" when it's there, e.g. CHECK ((version >= 0)) NOT VALID -> sql which is just invalid SQL once it lands in the generated migration. My first pass just stripped the NOT VALID suffix and kept the constraint, but I switched to excluding it entirely instead. There's nowhere in drizzle-kit that tracks whether a check constraint is validated, so keeping a "fixed" version around means a future push could quietly re-create it as validated - that's a real behavior change nobody asked for, on top of just fixing corrupted SQL. I noticed there's already a test for this exact issue in the repo ( in pull.test.ts, date-gated to turn on today) that expects exactly this - NOT VALID checks excluded from introspection. This PR is written to make that pass. Couldn't run it end to end locally though - it goes through a tsc check that needs the built drizzle-orm package, and building drizzle-orm on rc5 right now hits an unrelated rolldown error (MISSING_EXPORT on sql/expressions/index.ts) even on a clean checkout with nothing changed. I checked the actual behavior works directly against a real Postgres instance instead - a NOT VALID constraint gets excluded, a normal one on the same table comes through untouched.

ks342 · 13h ago
domuk-k
[BUG]: Pooled transaction() leaks the pool client when BEGIN fails (node-postgres / neon-serverless / vercel-postgres)OpenIssue

drizzle-orm: 0.45.2 — same code on (0.45.3) and (1.0.0-rc.4) drizzle-kit: 0.31.10 Other packages:** pg 8.22.0 Describe the Bug If runs on a and the statement fails, the client taken from the pool is never released. is executed before the that calls : does fail in practice: (), a connection dropped right after connect (, "Connection terminated unexpectedly"), admin shutdown. Each time, the pool loses one client for good. Under load eventually hangs on an empty pool. Repro without a database — subclass and make throw: Expected: the client is released on every exit path, including a failing . Moving inside the is enough: the existing runs (only a WARNING when no transaction is open) and releases. The error the caller sees stays the same . I have the fix plus a driver-mocked test for the three sessions; PR follows.

domuk-k · 13h ago

Recent fixes

View closed PRs →
gffuma
[BUG]: Studio crashes on a SQLite unique index that mixes an expression with a columnClosedIssue

Report hasn't been filed before. [x] I have verified that the bug I'm about to report hasn't been filed before. What version of are you using? 0.44.7 What version of are you using? 0.31.10 Other packages _No response_ Describe the Bug What is the undesired behavior? Drizzle Studio never loads: instead of the tables it renders a full-page "Unexpected error happened". The whole app is unusable, no table is browsable. The trigger is a UNIQUE index whose keys mix an expression with a plain column, e.g. . That is the case-insensitive unique pattern from your own guide (https://orm.drizzle.team/docs/guides/unique-case-insensitive-email) with a second column added to the index. I narrowed it down — same table, only the index differs: So it needs UNIQUE and the mix of an expression key with a column key. Quoting is irrelevant, and a non-unique index with the exact same keys is handled fine. For what it's worth, returns cid and a NULL name for the expression key, which looks like where the mapping gives up: This is a regression: the index in my project has been unchanged for ~5 months and Studio used to open it. Since the Studio app is served from local.drizzle.studio, pinning or downgrading drizzle-kit doesn't work around it. What are the steps to reproduce it? 1. Create the database: 2. : 3. Run . 4. Open the printed local.drizzle.studio URL. The page shows the error above and no tables. Dropping the key from the index, or making the index non-unique, makes it load. Client error IDs: , . What is the desired result? Studio opens and lets me browse the tables. An index Studio cannot fully model should degrade gracefully — skipped, or surfaced read-only — instead of becoming a fatal error that takes down the entire app. Ideally the expression key is handled the same way it already is for non-unique expression indexes. Environment Database engine: SQLite. Reproduced both on a local SQLite file () and on Cloudflare D1 through — same error, same index. Versions: drizzle-kit 0.31.10, drizzle-orm 0.44.7. Runtime: Node v24.16.0, macOS. The crash itself is client-side, inside the Studio bundle served from local.drizzle.studio. Monorepo: no. Types:** not a types issue — and are both happy; this only affects Studio.

gffuma · 16h ago
Structured data for AI agents

Repository: drizzle-team/drizzle-orm. Description: ORM Stars: 35687, Forks: 1583. Primary language: TypeScript. Languages: TypeScript (98.7%), JavaScript (1.3%). License: Apache-2.0. Homepage: https://orm.drizzle.team Topics: bunjs, mysql, nodejs, orm, postgres, postgresql, sql, sqlite, turso, typescript. Latest release: 0.45.2 (5mo ago). Open PRs: 100, open issues: 1903. Last activity: 15h ago. Community health: 87%. Top contributors: AndriiSherman, dankochetov, L-Mario564, AlexBlokh, Sukairo-02, Angelelz, AleksandrSherman, OleksiiKH0240, RomanNabukhotnyi, realmikesolo and others.

·@ofershap

Replace github.com with gitshow.dev