Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ package release is useful for users.

## Unreleased

No user-facing changes yet.
- Drizzle ORM v1 note: the Drizzle-Zod integration is built into drizzle-orm
on the v1 line (`drizzle-orm/zod`; zod is an optional peer there) — the
standalone `drizzle-zod` package stays on 0.x. Support policy corrected and
the v1 RC canary now smokes schema derivation + parsing through
`drizzle-orm/zod` (the spec skips on 0.x, where the subpath does not exist).

## 0.4.0 - 2026-07-05

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ Drizzle ORM v1 (`1.0.0-rc.x`) is supported for the **core surface** as of `0.4.0
the peer range admits `>=1.0.0-rc.1`, and the CI canary runs the full package
suite against `drizzle-orm@rc` — module wiring, DI, repositories, testing
helpers, and plain query building on all four drivers, including a real
CLS-adapter transaction. Two optional paths stay gated upstream:
CLS-adapter transaction. One optional path stays gated upstream:
`@nestjs-cls/transactional-adapter-drizzle-orm` still peer-pins `drizzle-orm@^0`
(works today with an npm override; tracked in
[Papooch/nestjs-cls#599](https://github.com/Papooch/nestjs-cls/issues/599)), and
`drizzle-zod` has no v1-compatible release. Details and the override recipe:
(works today with an npm override; fix proposed in
[Papooch/nestjs-cls#604](https://github.com/Papooch/nestjs-cls/pull/604)). The
Drizzle-Zod path is already solved on v1 — it moved into drizzle-orm as
`drizzle-orm/zod`, and the canary smokes it. Details and the override recipe:
[Drizzle ORM v1 (release candidate)](website/docs/support-policy.md#drizzle-orm-v1-release-candidate).

For peer dependency policy and API stability, see
Expand Down
18 changes: 12 additions & 6 deletions docs/support-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ regressed compatibility.
- `@nestjs-cls/transactional-adapter-drizzle-orm` peer-pins `drizzle-orm@^0`,
so installing it next to v1 needs an npm override until
[Papooch/nestjs-cls#599](https://github.com/Papooch/nestjs-cls/issues/599)
lands. Our canary runs the adapter's real commit/rollback against the RC and
lands (fix proposed in
[Papooch/nestjs-cls#604](https://github.com/Papooch/nestjs-cls/pull/604)).
Our canary runs the adapter's real commit/rollback against the RC and
it works at runtime; the override below is a workaround, not a support claim
for the adapter itself:

Expand All @@ -50,16 +52,20 @@ regressed compatibility.
}
```

- `drizzle-zod` has no v1-compatible release (its stable peer range excludes
prereleases), so the optional Drizzle-Zod validation path stays on the
`0.45.x` line.
**Drizzle-Zod on v1 — already solved upstream:** the integration moved into
drizzle-orm itself as the `drizzle-orm/zod` subpath (zod is an optional peer
of drizzle-orm there; `/valibot`, `/typebox`, and `/arktype` moved the same
way). The standalone `drizzle-zod` package stays on the 0.x line, so migrate
the import — `'drizzle-zod'` → `'drizzle-orm/zod'` — when adopting v1. The RC
canary smokes this path (schema derivation + parsing) on every push; the spec
skips on 0.x, where the subpath does not exist.

Two migration notes that live in Drizzle's API, not this package's: v1's
Relational Queries v2 changes what the database type generic means (tables
record → relations) and removes the positional-client init overloads — use the
unified `drizzle({ client })` form, which works on `0.32+` and v1 alike. When
v1 goes GA and the two packages above ship v1 support, this policy drops the
RC caveats; the peer range already covers `1.x`.
v1 goes GA and the CLS adapter ships v1 support, this policy drops the RC
caveats; the peer range already covers `1.x`.

## Public API Tiers

Expand Down
52 changes: 52 additions & 0 deletions packages/drizzle/test/drizzle-zod-v1.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';

// drizzle-orm v1 folds the Drizzle-Zod integration into the core package as
// the `drizzle-orm/zod` subpath (zod becomes an optional peer of drizzle-orm);
// the standalone `drizzle-zod` package stays on the 0.x line. This spec backs
// the support-policy claim for that path: it skips on 0.x base lanes (the
// subpath does not exist there) and runs on the v1 RC canary lane.
type ZodProbeSchema = {
safeParse: (value: unknown) => { success: boolean };
};
type DrizzleOrmZod = {
createSelectSchema: (table: unknown) => ZodProbeSchema;
createInsertSchema: (table: unknown) => ZodProbeSchema;
};

function loadDrizzleOrmZod(): DrizzleOrmZod | undefined {
try {
// Feature detection: a static import would fail module resolution on 0.x.
return require('drizzle-orm/zod') as DrizzleOrmZod;
} catch {
return undefined;
}
}

const drizzleOrmZod = loadDrizzleOrmZod();

const users = sqliteTable('zod_probe_users', {
id: integer('id').primaryKey({ autoIncrement: true }),
name: text('name').notNull(),
});

describe('drizzle-orm/zod (v1 built-in Drizzle-Zod)', () => {
it(
'derives select/insert schemas that validate rows',
{
skip: drizzleOrmZod
? false
: 'drizzle-orm/zod ships on the v1 line only (runs on the RC canary)',
},
() => {
assert.ok(drizzleOrmZod);
const select = drizzleOrmZod.createSelectSchema(users);
const insert = drizzleOrmZod.createInsertSchema(users);

assert.equal(select.safeParse({ id: 1, name: 'Ada' }).success, true);
assert.equal(select.safeParse({ id: 'x', name: 42 }).success, false);
assert.equal(insert.safeParse({ name: 'Grace' }).success, true);
},
);
});
18 changes: 12 additions & 6 deletions website/docs/support-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ regressed compatibility.
- `@nestjs-cls/transactional-adapter-drizzle-orm` peer-pins `drizzle-orm@^0`,
so installing it next to v1 needs an npm override until
[Papooch/nestjs-cls#599](https://github.com/Papooch/nestjs-cls/issues/599)
lands. Our canary runs the adapter's real commit/rollback against the RC and
lands (fix proposed in
[Papooch/nestjs-cls#604](https://github.com/Papooch/nestjs-cls/pull/604)).
Our canary runs the adapter's real commit/rollback against the RC and
it works at runtime; the override below is a workaround, not a support claim
for the adapter itself:

Expand All @@ -50,16 +52,20 @@ regressed compatibility.
}
```

- `drizzle-zod` has no v1-compatible release (its stable peer range excludes
prereleases), so the optional Drizzle-Zod validation path stays on the
`0.45.x` line.
**Drizzle-Zod on v1 — already solved upstream:** the integration moved into
drizzle-orm itself as the `drizzle-orm/zod` subpath (zod is an optional peer
of drizzle-orm there; `/valibot`, `/typebox`, and `/arktype` moved the same
way). The standalone `drizzle-zod` package stays on the 0.x line, so migrate
the import — `'drizzle-zod'` → `'drizzle-orm/zod'` — when adopting v1. The RC
canary smokes this path (schema derivation + parsing) on every push; the spec
skips on 0.x, where the subpath does not exist.

Two migration notes that live in Drizzle's API, not this package's: v1's
Relational Queries v2 changes what the database type generic means (tables
record → relations) and removes the positional-client init overloads — use the
unified `drizzle({ client })` form, which works on `0.32+` and v1 alike. When
v1 goes GA and the two packages above ship v1 support, this policy drops the
RC caveats; the peer range already covers `1.x`.
v1 goes GA and the CLS adapter ships v1 support, this policy drops the RC
caveats; the peer range already covers `1.x`.

## Public API Tiers

Expand Down