Skip to content

Commit a3904ac

Browse files
Bump to version 0.13.0 (#789)
Bumps the root `package.json` version and every workspace package in lockstep: **0.12.0 → 0.13.0**. Merging this PR ships the release: the push to `main` carries the bumped root `version`, the `Publish to npm` workflow detects the change and publishes `0.13.0` under dist-tag `latest`, and a matching GitHub Release is created automatically (its body is `docs/releases/v0.13.0.md`). ## What's in the diff - **`chore(release): bump to 0.13.0`** — `version` bump across all 85 workspace `package.json` files plus the `workspace:0.12.0 → workspace:0.13.0` specifier updates in `pnpm-lock.yaml`. Nothing else changes. - **`docs(release): add release notes for v0.13.0`** — the committed [`docs/releases/v0.13.0.md`](docs/releases/v0.13.0.md) and the mirrored `CHANGELOG.md` entry. ## Review surface [`docs/releases/v0.13.0.md`](docs/releases/v0.13.0.md) is the human-review surface for this release's user-facing changes — it becomes the GitHub Release body verbatim. Please check the triage and one-line summaries against the merged PRs since `v0.12.0`. Highlights: telemetry flips to opt-out, namespaces become first-class on the query surface, many-to-many + cross-contract foreign keys land in the SQL ORM, the `@@control` per-object control policy ships, domain enums arrive, and the migration CLI gets a unified graph-tree view. Breaking changes carry their migration recipes. See [`docs/oss/versioning.md`](docs/oss/versioning.md) for the version contract and release procedure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Version bump to v0.13.0 across workspace packages and examples. * **Documentation** * Release notes for v0.13.0 added, plus upgrade instructions. * **Breaking Changes** * Telemetry now opt-out by default. * Contract storage emission changes may require re-emitting/re-basing contracts (namespace-wrapped storage). * **New Features** * Namespace-aware ORM/SQL surfaces, improved SQL ORM relations (N:M), cross-contract foreign keys, per-object control, domain enums, SQLite transactions, Supabase extension. * **Bug Fixes** * Offline schema projection and collation-independent storage-sort fixes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Will Madden <madden@prisma.io> Co-authored-by: Will Madden <madden@prisma.io>
1 parent 7faa60c commit a3904ac

100 files changed

Lines changed: 2588 additions & 2048 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ Changelog tracking starts at **v0.12.0**, the first release cut after this conve
66

77
<!-- New release entries go here, newest first, each mirroring docs/releases/v<version>.md under a `## v<version>` header. -->
88

9-
## v0.13.0 (unreleased)
9+
## v0.13.0
10+
11+
This release makes namespaces a first-class part of the query surface, adds cross-contract foreign keys to the SQL ORM, makes many-to-many a validatable contract shape, introduces a per-object control policy (`@@control`) that decides what Prisma manages, ships domain enums backed by storage value-sets, and gives the migration CLI a unified graph-tree view across `list` / `log` / `status` / `show`. Telemetry also flips from opt-in to opt-out. A few changes require a one-time contract re-emit — all are covered by the linked upgrade recipes.
1012

1113
### Breaking changes
1214

13-
- **MTI variant tables materialize a base-PK link column** (`@prisma-next/sql-contract-psl`) — a PSL `@@base(Parent, "tag")` variant that carries its own `@@map` (and is therefore stored in its own table) now emits a base-PK link column in storage: the variant table gains an `id` column, a single-column primary key on it, and a cascading foreign key (`ON DELETE CASCADE`) referencing the base table's primary key. Previously the variant table held only the variant-specific columns with no primary key and no link to its base. This changes the emitted `contract.json` / `contract.d.ts` and the contract's `storageHash`. Re-emit your contract, then plan and apply the matching migration to add the column, PK, and FK to your database. Variants that share the base table (no own `@@map`) are unaffected. See the [migration recipe](https://github.com/prisma/prisma-next/blob/v0.13.0/skills/upgrade/prisma-next-upgrade/upgrades/0.12-to-0.13/). ([#669](https://github.com/prisma/prisma-next/pull/669))
15+
- **Telemetry is now opt-out** — anonymous CLI telemetry is collected by default and you opt out, where previously you opted in. Set `PRISMA_NEXT_DISABLE_TELEMETRY=1` (or `DO_NOT_TRACK=1`) to turn it off. See [`docs/Telemetry.md`](https://github.com/prisma/prisma-next/blob/v0.13.0/docs/Telemetry.md) for what is collected and every opt-out signal. ([#676](https://github.com/prisma/prisma-next/pull/676))
16+
17+
- **MTI variant tables materialize a base-PK link column** — a PSL `@@base(Parent, "tag")` variant that carries its own `@@map` (and is therefore stored in its own table) now emits a base-PK link column in storage: the variant table gains a copy of the base table's primary-key column(s), a primary key over them, and a cascading foreign key (`ON DELETE CASCADE`) referencing the base table's primary key. Previously the variant table held only the variant-specific columns with no primary key and no link to its base. This changes the emitted `contract.json` / `contract.d.ts` and the contract's `storageHash`. Re-emit your contract, then plan and apply the matching migration. Variants that share the base table (no own `@@map`) are unaffected. See the [0.12→0.13 upgrade recipe](https://github.com/prisma/prisma-next/blob/v0.13.0/skills/upgrade/prisma-next-upgrade/upgrades/0.12-to-0.13/). ([#669](https://github.com/prisma/prisma-next/pull/669))
1418

1519
Before (emitted `contract.json`, variant table `bug`):
1620

@@ -42,9 +46,72 @@ Changelog tracking starts at **v0.12.0**, the first release cut after this conve
4246
}
4347
```
4448

49+
- **Contract storage IR moved to a namespace envelope** — the SQL/Mongo storage IR is now keyed by namespace (`storage.namespaces.<ns>.entries.<kind>`), and cross-references are explicit `{ namespace, model }` objects in `domain`. Consumer impact is mechanical: re-emit with `prisma-next contract emit` to pick up the new shape. No codemod or source change is required, but the contract's `storageHash` changes, so plan and apply a migration afterward. ([#715](https://github.com/prisma/prisma-next/pull/715))
50+
51+
- **Extension authors: codec-resolution SPI takes a leading `namespaceId`**`CodecDescriptorRegistry.codecRefForColumn(table, column)` is now `codecRefForColumn(namespaceId, table, column)`, and the free `codecRefForStorageColumn(storage, table, column)` is now `codecRefForStorageColumn(storage, namespaceId, table, column)` (both in `@prisma-next/sql-relational-core`). Thread the namespace the table lives in through every call site that stamps `codec` onto AST nodes. There is no codemod — the right namespace is call-site-specific. See the [0.12→0.13 extension-author recipe](https://github.com/prisma/prisma-next/blob/v0.13.0/skills/extension-author/prisma-next-extension-upgrade/upgrades/0.12-to-0.13/). ([#715](https://github.com/prisma/prisma-next/pull/715))
52+
53+
Before:
54+
55+
```ts
56+
const ref = descriptors.codecRefForColumn('document', 'embedding');
57+
```
58+
59+
After:
60+
61+
```ts
62+
const ref = descriptors.codecRefForColumn('public', 'document', 'embedding');
63+
```
64+
65+
- **Extension authors: empty `typeParams` stripped from `storage.types`** — the canonicalizer now omits `typeParams` from `storage.types` entries when it is an empty object (e.g. a `types { Uuid = String @db.Uuid }` named-type alias). Runtime behaviour is unchanged, but the emitted `contract.json` and its `storageHash` differ. If your extension shipped a `contract.json` with `"typeParams": {}`, re-emit and re-pin your migration baselines. See the [0.12→0.13 extension-author recipe](https://github.com/prisma/prisma-next/blob/v0.13.0/skills/extension-author/prisma-next-extension-upgrade/upgrades/0.12-to-0.13/). ([#753](https://github.com/prisma/prisma-next/pull/753))
66+
4567
### Features
4668

47-
- **STI variants can declare their own fields** (`@prisma-next/sql-contract-psl`) — a PSL `@@base(Parent, "tag")` variant with no own `@@map` (single-table inheritance) may now declare its own scalar fields. Each such field is materialized as a column on the shared base table (always nullable in storage, since the base table also holds sibling-variant rows), and the variant no longer emits a stray shadow table. Previously the variant's column was never added to the base table, so the contract failed to emit with `references non-existent column`. This is purely enabling: existing contracts re-emit identically. ([#669](https://github.com/prisma/prisma-next/pull/669))
69+
- **Namespace-aware DSL/ORM surface** — the typed query and ORM surface now exposes namespaced accessors so models in different namespaces are addressed explicitly and two same-named tables in different namespaces no longer collide. Additive — existing single-namespace code is unchanged. ([#720](https://github.com/prisma/prisma-next/pull/720))
70+
71+
- **Many-to-many is now a validatable contract shape**`N:M` relations carrying a `through` junction descriptor are now a first-class, validatable part of the contract (they previously failed validation). The ORM runtime surface for M:N`.include()` across the junction, `some`/`every`/`none` filters, and junction writes — is not wired up yet and lands in a follow-up release; nested M:N mutations currently throw. ([#669](https://github.com/prisma/prisma-next/pull/669), [#678](https://github.com/prisma/prisma-next/pull/678))
72+
73+
- **Cross-contract foreign keys** — a relation field can reference a model owned by another contract space (e.g. `supabase:auth.AuthUser`), with named-type aliases (`types { Uuid = String @db.Uuid }`) for database-native column types. The planner and verifier resolve the cross-space reference and emit the foreign key, including cascading deletes. See the [0.12→0.13 upgrade recipe](https://github.com/prisma/prisma-next/blob/v0.13.0/skills/upgrade/prisma-next-upgrade/upgrades/0.12-to-0.13/) for the authoring pattern. ([#745](https://github.com/prisma/prisma-next/pull/745), [#752](https://github.com/prisma/prisma-next/pull/752), [#756](https://github.com/prisma/prisma-next/pull/756), [#765](https://github.com/prisma/prisma-next/pull/765))
74+
75+
```prisma
76+
types {
77+
Uuid = String @db.Uuid
78+
}
79+
80+
namespace public {
81+
model Profile {
82+
id String @id @default(uuid())
83+
username String
84+
userId Uuid @unique
85+
user supabase:auth.AuthUser @relation(fields: [userId], references: [id], onDelete: Cascade)
86+
@@map("profile")
87+
}
88+
}
89+
```
90+
91+
- **Per-object control policy (`@@control`)** — a model or other contract object can declare whether Prisma manages its schema, and a contract can set a `defaultControlPolicy`. Migration DDL generation and schema verification react to each object's policy, so you can keep externally-owned objects out of Prisma's managed surface. ([#717](https://github.com/prisma/prisma-next/pull/717), [#711](https://github.com/prisma/prisma-next/pull/711))
92+
93+
- **Domain enums with storage value-sets** — enums are now a domain concept backed by storage value-sets. On Postgres, `enum` blocks lower to a native enum type (`CREATE TYPE … AS ENUM`); SQL targets without native enum support approximate the allowed values with check constraints. ([#750](https://github.com/prisma/prisma-next/pull/750), [#755](https://github.com/prisma/prisma-next/pull/755))
94+
95+
- **Unified migration graph view in the CLI**`migration list`, `log`, `status`, and `show` now render the migration history as a consistent graph tree with colored lanes, a `--legend`, and one schema-locked `--json` shape across the read commands. `migrate --show` previews the migration path read-only before you apply it. ([#706](https://github.com/prisma/prisma-next/pull/706), [#704](https://github.com/prisma/prisma-next/pull/704), [#705](https://github.com/prisma/prisma-next/pull/705), [#735](https://github.com/prisma/prisma-next/pull/735), [#741](https://github.com/prisma/prisma-next/pull/741), [#767](https://github.com/prisma/prisma-next/pull/767))
96+
97+
- **Readable per-migration ledger** — the migration apply ledger is now a per-migration journal, read back as one flat chronological table by `migration log`. ([#665](https://github.com/prisma/prisma-next/pull/665), [#704](https://github.com/prisma/prisma-next/pull/704))
98+
99+
- **`db.transaction()` on the SQLite facade**`@prisma-next/sqlite` gains a facade-level transaction API (`db.transaction(async (tx) => …)`), mirroring the Postgres facade. ([#737](https://github.com/prisma/prisma-next/pull/737))
100+
101+
- **Declarative SPI for extension-contributed PSL blocks** — extensions can declare top-level PSL blocks declaratively, and `contract infer` round-trips them through a generic PSL printer. ([#753](https://github.com/prisma/prisma-next/pull/753), [#754](https://github.com/prisma/prisma-next/pull/754), [#757](https://github.com/prisma/prisma-next/pull/757))
102+
103+
- **`@prisma-next/extension-supabase`** — a new extension package and an `examples/supabase` walking skeleton that wires a cross-contract foreign key from an app model to Supabase's `auth` schema. ([#746](https://github.com/prisma/prisma-next/pull/746), [#765](https://github.com/prisma/prisma-next/pull/765))
104+
105+
- **STI variants can declare their own fields** — a PSL `@@base(Parent, "tag")` variant with no own `@@map` (single-table inheritance) may now declare its own scalar fields. Each is materialized as a (nullable) column on the shared base table, and the variant no longer emits a stray shadow table. Previously such a contract failed to emit with `references non-existent column`. Existing contracts re-emit identically. ([#669](https://github.com/prisma/prisma-next/pull/669))
106+
107+
- **Backward cursor pagination**`OrderByItem.reverse()` flips an order-by direction for fetching the previous page. ([#671](https://github.com/prisma/prisma-next/pull/671))
108+
109+
- **Postgres JSON defaults emit a `::jsonb` / `::json` cast** — JSON column defaults now carry the explicit cast in generated DDL. ([#763](https://github.com/prisma/prisma-next/pull/763))
110+
111+
### Fixes
112+
113+
- Constraintless foreign keys are skipped in offline schema projection. ([#744](https://github.com/prisma/prisma-next/pull/744))
114+
- Storage-sort comparison is now collation-independent. ([#721](https://github.com/prisma/prisma-next/pull/721))
48115

49116
## v0.12.0
50117

apps/telemetry-backend/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prisma-next/telemetry-backend",
3-
"version": "0.12.0",
3+
"version": "0.13.0",
44
"private": true,
55
"type": "module",
66
"engines": {
@@ -22,24 +22,24 @@
2222
"clean": "rm -rf dist coverage"
2323
},
2424
"dependencies": {
25-
"@prisma-next/postgres": "workspace:0.12.0",
26-
"@prisma-next/sql-runtime": "workspace:0.12.0",
25+
"@prisma-next/postgres": "workspace:0.13.0",
26+
"@prisma-next/sql-runtime": "workspace:0.13.0",
2727
"arktype": "catalog:",
2828
"evlog": "^2.18.1"
2929
},
3030
"devDependencies": {
3131
"@prisma/compute-sdk": "^0.17.0",
3232
"@prisma/management-api-sdk": "^1.29.0",
33-
"@prisma-next/adapter-postgres": "workspace:0.12.0",
34-
"@prisma-next/cli": "workspace:0.12.0",
35-
"@prisma-next/contract": "workspace:0.12.0",
36-
"@prisma-next/driver-postgres": "workspace:0.12.0",
37-
"@prisma-next/family-sql": "workspace:0.12.0",
38-
"@prisma-next/framework-components": "workspace:0.12.0",
39-
"@prisma-next/sql-contract": "workspace:0.12.0",
40-
"@prisma-next/target-postgres": "workspace:0.12.0",
41-
"@prisma-next/test-utils": "workspace:0.12.0",
42-
"@prisma-next/tsconfig": "workspace:0.12.0",
33+
"@prisma-next/adapter-postgres": "workspace:0.13.0",
34+
"@prisma-next/cli": "workspace:0.13.0",
35+
"@prisma-next/contract": "workspace:0.13.0",
36+
"@prisma-next/driver-postgres": "workspace:0.13.0",
37+
"@prisma-next/family-sql": "workspace:0.13.0",
38+
"@prisma-next/framework-components": "workspace:0.13.0",
39+
"@prisma-next/sql-contract": "workspace:0.13.0",
40+
"@prisma-next/target-postgres": "workspace:0.13.0",
41+
"@prisma-next/test-utils": "workspace:0.13.0",
42+
"@prisma-next/tsconfig": "workspace:0.13.0",
4343
"@types/bun": "^1.2.18",
4444
"@types/node": "catalog:",
4545
"@types/pg": "catalog:",

0 commit comments

Comments
 (0)