Chore/prisma next 0.14 upgrade#608
Conversation
…ive type assertions Biome reflows these assertions to multi-line, which strands the directive on the line before the one where tsc reports TS2344. Move the directive inside the generic so it sits directly above the erroring line and survives formatting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…hecking Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per-transition changes (extension-author upgrade instructions 0.8→0.9):
- strip fromContract/toContract from the seed migration manifest
(strip-inline-contracts codemod)
Additional 0.9 SPI churn not covered by the instructions:
- accept the widened InsertValue union in the bulk-encrypt routing-key
stamp (insert rows and update/on-conflict sets now carry
PreparedParamRef | DefaultValueExpr variants)
- validateContract moved: @prisma-next/sql-contract/validate is gone;
use validateSqlContractFully from /validators (single-argument)
- SqlStorage requires namespaces: construct test fixture storage via
new SqlStorage(...) so the constructor defaults the namespace map
- adapter lower() emits structured LoweredParam entries; unwrap
{kind:'literal', value} in operator-lowering assertions
(literalParamValue helper)
- named-type storage entries are stamped kind:'codec-instance'
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per-transition changes (extension-author upgrade instructions 0.9→0.10):
- storage.types kind-stamping: no-op for this package (no storage.types
entries on disk or constructed in source; verified with the codemod's
--check mode)
Additional 0.10 SPI churn not covered by the instructions:
- the storage IR is namespace-enveloped: tables live under
storage.namespaces.<ns> (late-bound __unbound__ here) instead of
flat storage.tables; the structural validator rejects the old shape
- deriveStackSchemas walks every namespace's tables
- all contract fixtures and storage reads updated to the new shape
- FieldEventContext gained a required namespaceId coordinate; all
direct codec-hook invocations in tests pass '__unbound__'
- re-emitted src/contract.{json,d.ts} via prisma-next contract emit
(storageHash changed with the namespace envelope) and re-pinned the
baseline migration: end-contract.{json,d.ts}, migration.ts describe()
to-hash, self-emitted ops.json/migration.json, migrations/refs/head.json
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
All five 0.10→0.11 extension-author changes are no-ops for this package (no handcrafted Contract type literals, no facade, no Mongo, no .insert()/.withValues() call sites). Additional 0.11 SPI churn: update/on-conflict set values widened to AnyExpression; the bulk-encrypt routing-key stamp accepts the wider union (it only acts on kind === 'param-ref'). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per-transition changes (extension-author upgrade instructions 0.11→0.12):
- strip-migration-labels-hints: codemod removed labels/hints from the
seed migration manifest and recomputed migrationHash
- extension-public-default-baseline: re-emitted the contract space —
the default namespace flips __unbound__/postgres-unbound-schema →
public/postgres-schema — and re-pinned the baseline migration
(end-contract.{json,d.ts}, migration.ts to-hash, self-emitted
ops.json/migration.json, refs/head.json)
- domain plane: contract.json now carries domain.namespaces instead of
flat models; roots entries are { model, namespace } objects; all
handcrafted contract fixtures replace models:{} with
domain.namespaces.<ns>.models
Additional 0.12 SPI churn not covered by the instructions:
- SqlMiddlewareContext (via RuntimeMiddlewareContext) gained a required
planExecutionId — middleware test contexts stamp a fixed id
- SqlStorageInput.namespaces is now Readonly<Record<string, SqlNamespace>>;
test fixtures construct entries via buildSqlNamespace(...)
- the PSL interpreter emits authored tables into the target-owned
default namespace (public on Postgres); asStorage test helpers walk
all namespaces instead of hard-coding __unbound__
- assertDescriptorSelfConsistency now recomputes through the family
canonicalization hooks; the descriptor test passes
sqlContractCanonicalizationHooks explicitly
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per-transition changes (extension-author upgrade instructions 0.12→0.13):
- storage-namespace-envelope-re-emit: re-emitted the contract space —
storage entries move under storage.namespaces.<ns>.entries.<kind> —
and re-pinned the baseline migration (end-contract.{json,d.ts},
migration.ts to-hash, self-emitted ops.json/migration.json,
refs/head.json). The 0.13 emitter also injects an empty __unbound__
namespace slot alongside public; 0.14 removes it (TML-2916).
- sqlite-create-table-method, strip-empty-type-params, and
codec-ref-resolver namespaceId threading: no-ops for this package
(no SQLite migrations, no empty typeParams, no direct codec-ref
construction)
Additional 0.13 SPI churn not covered by the instructions:
- SqlNamespaceTablesInput moved tables into the entries envelope:
buildSqlNamespace({ id, entries: { table } }); contract fixtures and
namespace reads updated
- TargetPackRef gained required defaultNamespaceId ('public' for the
Postgres stub in the PSL interpreter tests)
- interpretPslDocumentToSqlContract requires composedExtensionContracts;
tests pass the cipherstash contract keyed by its space id
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per-transition changes (extension-author upgrade instructions 0.13→0.14): - migration-op-factories-to-methods: ran the codemod; the seed migration's only op factory is rawSql, which survives in 0.14 — import churn only - create-runtime-removed: code was unaffected (createRuntime appeared only in doc comments, now updated to new PostgresRuntimeImpl) - re-emitted the contract space (the 0.14 emitter drops the spurious empty __unbound__ namespace slot, TML-2916, and no longer emits ContractModelDefinitions) and re-pinned the baseline migration - uuid presets, flat builder accessors, namespace-entries dot access, enum surface, namespaced TypeMaps/TableProxy, ContractModelDefinitions: no-ops for this package - planFieldEventOperations op calls can lower lazily; descriptor tests await Promise.all(ops.map(c => c.toOp())) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…geset for the 0.14 upgrade Prisma Next 0.14 removed the flat orm.<Model> accessors; the README examples now go through db.orm.public.User. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Design for authoring EQL v3 columns in @cipherstash/prisma-next via concrete per-domain constructors that map 1:1 to the public.* Postgres domains, with capabilities encoded in the type system (no boolean-option surface, no resolver). Reflects protect-ffi 0.28: public.* domains + eql_v3.* operator functions, first-class BigInt family, DOMAIN_REGISTRY as source of truth, separate v2/v3 entry points, and concrete per-domain types threaded end-to-end.
Add the design-A implementation plan and remediate the review findings. Real bugs fixed: - cipherstashBetween is now a self-parenthesised conjunction '(gte AND lte)' so any generic NOT/OR composition is safe (Postgres binds NOT tighter than AND; the 9c82f50 bug class). Operator-lowering tests pin the full parenthesised skeleton for all operators and assert NOT (gte AND lte). - v3ToDriver restores bigintSafeReplacer; a stray bigint in a malformed envelope serialises instead of throwing. Pinned by a test. - codec-runtime encode test now exercises the real envelope/.expose() contract (the old test fed a plain object with no .expose(), so it never passed). - constants-v3 drift test replaced the masking cast with a pinned literal tuple (as const satisfies) + bidirectional Exclude guard + runtime equality check. Type spine (the core of v3): - Authoring factories are typed per-domain via v3Authored(types.X): distinct return type per domain, literal codecId/nativeType/capabilities (never string/unknown). Mandatory column-types.test-d.ts pins non-assignability + literal field types. Derivation preserves the concrete column type. Separate v2/v3 entry points (decision 1b): - v3 registers its own extension descriptor with a distinct CIPHERSTASH_V3_SPACE_ID/VERSION, keeping the same cipherstash* method names, and is never co-registered with v2 (the flat OperationRegistry rejects the duplicate method). Task 7 replaces the two-client dispatch with a v3-only cipherstashFromStackV3; a v2 codec id in a v3 contract is a hard error. Plan under docs/superpowers/plans/ (locally git-excluded; force-added). Remaining (follow-up): encrypted ORDER BY (asc/desc -> eql_v3.ord_term), shared-primitive lift to eql/v3/, bulk-middleware edge-case tests, live plaintext-oracle suite, genuine property tests, minor type cleanups.
The plan and spec were drafted against @prisma-next/* 0.8.0; the package is now pinned at 0.14.0. Changes: - new 'Prisma Next 0.14 ground truth' section: namespace-enveloped contract shape (storage.namespaces.<ns>.entries.table, domain plane, public default namespace), the manual contract-emit/re-pin loop (self- emit writes only ops.json + migration.json), current head hash, validateSqlContractFully fixture shape, structured LoweredParam, PSL-interpreter harness requirements (defaultNamespaceId, composedExtensionContracts), FieldEventContext namespaceId, lazily awaitable toOp(), planExecutionId on middleware contexts, createRuntime removal (rawSql survives), canonicalization hooks for descriptor self-consistency - Task 7 + Task 9: V3ContractShape / deriveStackSchemasV3 / fixtures walk the 0.14 namespace envelope instead of flat storage.tables - Task 8: v3 baseline describe() chains from the v2 head hash; Step 4 rewritten as the real 0.14 emit loop with the invariant-only-edge question called out for verification - Task 3/6: point new tests at the 0.14-shaped harnesses on this branch - Task 10: replace the mixed-v2-v3-in-one-client live test (contradicted decision 1b and the spec) with side-by-side v2/v3 clients; the live suites go through cipherstashFromStackV3 - spec: revision pointer 2026-07-09c Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…veStackSchemas The 0.12→0.13 upgrade step moved storage namespaces to the entries.<kind> envelope but deriveStackSchemas kept reading namespace.tables — its unit fixtures were updated in lockstep, so the suite stayed green while derivation returned [] against a real 0.14-emitted contract.json (cipherstashFromStack would throw 'no cipherstash columns found'). Caught by typechecking the example app against its re-emitted contract. Fixtures now mirror the real emitted shape. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- deps: every @prisma-next/* pinned at 0.14.0 - prisma-next.config.ts: prismaContract takes the target PACK ref (@prisma-next/target-postgres/pack, carrying defaultNamespaceId) instead of the control descriptor - contract re-emitted in the 0.14 shape (public namespace, entries envelope, domain plane); migrations regenerated from scratch — fresh app initial migration + the cipherstash extension space re-materialised from the upgraded workspace package (head sha256:1e86a016…) - ORM/builder access namespace-qualified: db.orm.public.User, db.sql.public.users (src/index.ts + every e2e suite) - the CLI renamed 'migration apply' to 'migrate': package.json script, e2e global-setup, and READMEs updated (--yes for non-interactive runs) - e2e walkthrough test (e2e/tests/prisma-example-readme.e2e.test.ts): snapshot/restore examples/prisma/.env instead of deleting it in teardown — the old teardown destroyed a developer's real credentials file Full example e2e suite green against the docker harness: 36 passed, 1 skipped (known jsonbPathExists limitation). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 85175c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThis PR upgrades ChangesPrisma Next 0.14 Upgrade
Estimated code review effort: 3 (Moderate) | ~30 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…gres port - the e2e global-setup and the README-walkthrough test now accept the ~/.cipherstash profile written by 'stash auth login' (device-code flow stores device.json, not auth.json) — no .env with CS_* values is required for local runs; the stack client resolves the profile - move the bundled Postgres from port 5544 to 54338 (matching the 54329-style e2e harness port) — 5544 is a common enough choice to collide with other local containers, which cascaded into migrate/start failures in the walkthrough Both suites green on profile auth alone: example e2e 36 passed / 1 skipped; README walkthrough 7/7 steps exit 0 (including pnpm start). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e/prisma-next-0.14-upgrade
There was a problem hiding this comment.
🧹 Nitpick comments (3)
docs/superpowers/specs/2026-07-08-eql-v3-prisma-next-design.md (1)
80-80: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd language specifiers to fenced code blocks.
Three code blocks lack a language identifier, flagged by markdownlint (MD040). Line 80 lists TypeScript factory names (
ts), lines 297 and 310 show SQL operator templates (sql).📝 Proposed fix
-``` +```ts types.Text, types.TextEq, types.TextMatch, types.TextOrd, types.TextOrdOre, types.TextSearch-``` +```sql eql_v3.eq({{self}}, {{arg0}}::jsonb)-``` +```sql (eql_v3.gte({{self}}, {{arg0}}::jsonb) AND eql_v3.lte({{self}}, {{arg1}}::jsonb))Also applies to: 297-297, 310-310
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/superpowers/specs/2026-07-08-eql-v3-prisma-next-design.md` at line 80, Add language identifiers to the fenced code blocks in the spec so markdownlint MD040 passes: update the TypeScript factory-name block in the documentation to use the proper ts fence, and update both SQL operator template blocks to use sql fences. Use the existing fenced-code sections around the referenced ts and eql_v3 template examples to locate and fix them without changing the content inside the blocks.Source: Linters/SAST tools
packages/prisma-next/test/psl-interpretation-numeric.test.ts (1)
66-85: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the duplicated
asStoragehelper to a shared test utility.The same
asStoragefunction (flatteningstorage.namespacesinto a flattablesmap) is duplicated verbatim inpsl-interpretation-numeric.test.ts,psl-interpretation-other-types.test.ts, andpsl-interpretation.test.ts. If the storage IR shape changes again, all three copies must be updated independently. Extracting it to a shared helper (e.g., inoperator-lowering.helpers.tsor a newtest/psl-helpers.ts) would eliminate this risk.♻️ Suggested extraction
Create a shared helper, e.g. in
test/psl-helpers.ts:import type { StorageView } from './psl-interpretation.types' // or define inline export function asStorage(storage: unknown): StorageView { const s = storage as { readonly namespaces?: Record< string, { entries?: { table?: StorageView['tables'] } } > readonly types?: StorageView['types'] } const tables: StorageView['tables'] = {} for (const ns of Object.values(s.namespaces ?? {})) { Object.assign(tables, ns.entries?.table) } return { tables, ...(s.types !== undefined ? { types: s.types } : {}), } }Then replace the inline copies in all three test files with an import.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/prisma-next/test/psl-interpretation-numeric.test.ts` around lines 66 - 85, The duplicated asStorage helper should be moved into a shared test utility so all PSL interpretation tests use the same implementation. Extract the namespace-flattening logic from asStorage into a common helper (for example in a shared test helpers module) and then update psl-interpretation-numeric.test.ts, psl-interpretation-other-types.test.ts, and psl-interpretation.test.ts to import and use it. Keep the helper’s behavior identical, including flattening storage.namespaces into tables and preserving types when present.packages/prisma-next/test/derive-schemas.test.ts (1)
31-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider adding a multi-namespace test case.
All tests use a single
__unbound__namespace. A test with two or more namespaces (each containing distinct tables, and optionally a same-named table to verify merge/collision behavior) would exercise theObject.assignflattening loop inderiveStackSchemasand protect against the silent overwrite risk flagged inderive-schemas.ts.🧪 Suggested multi-namespace test
it('merges tables from multiple namespaces', () => { const contract = { storage: { namespaces: { __unbound__: { entries: { table: { users: { columns: { email: { codecId: 'cipherstash/string@1' } } }, }, }, }, public: { entries: { table: { posts: { columns: { title: { codecId: 'cipherstash/string@1' } } }, }, }, }, }, }, } const schemas = deriveStackSchemas(contract) expect(schemas).toHaveLength(2) expect(schemas.map(s => s.name).sort()).toEqual(['posts', 'users']) })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/prisma-next/test/derive-schemas.test.ts` around lines 31 - 50, Add a multi-namespace test in derive-schemas.test.ts that exercises deriveStackSchemas with two or more namespaces instead of only __unbound__. Build distinct tables per namespace and include an optional same-named table to verify the Object.assign flattening behavior and detect any silent overwrite or merge issues. Use the existing deriveStackSchemas test setup as the anchor and extend the fixture structure under namespaces to cover this collision scenario.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@docs/superpowers/specs/2026-07-08-eql-v3-prisma-next-design.md`:
- Line 80: Add language identifiers to the fenced code blocks in the spec so
markdownlint MD040 passes: update the TypeScript factory-name block in the
documentation to use the proper ts fence, and update both SQL operator template
blocks to use sql fences. Use the existing fenced-code sections around the
referenced ts and eql_v3 template examples to locate and fix them without
changing the content inside the blocks.
In `@packages/prisma-next/test/derive-schemas.test.ts`:
- Around line 31-50: Add a multi-namespace test in derive-schemas.test.ts that
exercises deriveStackSchemas with two or more namespaces instead of only
__unbound__. Build distinct tables per namespace and include an optional
same-named table to verify the Object.assign flattening behavior and detect any
silent overwrite or merge issues. Use the existing deriveStackSchemas test setup
as the anchor and extend the fixture structure under namespaces to cover this
collision scenario.
In `@packages/prisma-next/test/psl-interpretation-numeric.test.ts`:
- Around line 66-85: The duplicated asStorage helper should be moved into a
shared test utility so all PSL interpretation tests use the same implementation.
Extract the namespace-flattening logic from asStorage into a common helper (for
example in a shared test helpers module) and then update
psl-interpretation-numeric.test.ts, psl-interpretation-other-types.test.ts, and
psl-interpretation.test.ts to import and use it. Keep the helper’s behavior
identical, including flattening storage.namespaces into tables and preserving
types when present.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f4747251-b262-4ac3-9919-038351d14df7
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (68)
.changeset/prisma-next-0-14.mddocs/superpowers/plans/2026-07-08-eql-v3-prisma-next.mddocs/superpowers/specs/2026-07-08-eql-v3-prisma-next-design.mde2e/tests/prisma-example-readme.e2e.test.tsexamples/prisma/.env.exampleexamples/prisma/README.mdexamples/prisma/docker-compose.ymlexamples/prisma/migrations/app/20260513T1735_initial/end-contract.d.tsexamples/prisma/migrations/app/20260513T1735_initial/migration.jsonexamples/prisma/migrations/app/20260513T1735_initial/migration.tsexamples/prisma/migrations/app/20260709T1034_initial/end-contract.d.tsexamples/prisma/migrations/app/20260709T1034_initial/end-contract.jsonexamples/prisma/migrations/app/20260709T1034_initial/migration.jsonexamples/prisma/migrations/app/20260709T1034_initial/migration.tsexamples/prisma/migrations/app/20260709T1034_initial/ops.jsonexamples/prisma/migrations/cipherstash/20260601T0000_install_eql_bundle/contract.jsonexamples/prisma/migrations/cipherstash/20260601T0000_install_eql_bundle/migration.jsonexamples/prisma/migrations/cipherstash/20260601T0000_install_eql_bundle/ops.jsonexamples/prisma/migrations/cipherstash/contract.d.tsexamples/prisma/migrations/cipherstash/contract.jsonexamples/prisma/migrations/cipherstash/refs/head.jsonexamples/prisma/package.jsonexamples/prisma/prisma-next.config.tsexamples/prisma/src/index.tsexamples/prisma/src/prisma/contract.d.tsexamples/prisma/src/prisma/contract.jsonexamples/prisma/test/e2e/README.mdexamples/prisma/test/e2e/bigint.e2e.test.tsexamples/prisma/test/e2e/bool.e2e.test.tsexamples/prisma/test/e2e/date.e2e.test.tsexamples/prisma/test/e2e/global-setup.tsexamples/prisma/test/e2e/json.e2e.test.tsexamples/prisma/test/e2e/mixed.e2e.test.tsexamples/prisma/test/e2e/num.e2e.test.tsexamples/prisma/test/e2e/str-range.e2e.test.tspackages/prisma-next/README.mdpackages/prisma-next/migrations/20260601T0000_install_eql_bundle/end-contract.d.tspackages/prisma-next/migrations/20260601T0000_install_eql_bundle/end-contract.jsonpackages/prisma-next/migrations/20260601T0000_install_eql_bundle/migration.jsonpackages/prisma-next/migrations/20260601T0000_install_eql_bundle/migration.tspackages/prisma-next/migrations/20260601T0000_install_eql_bundle/ops.jsonpackages/prisma-next/migrations/refs/head.jsonpackages/prisma-next/package.jsonpackages/prisma-next/src/contract.d.tspackages/prisma-next/src/contract.jsonpackages/prisma-next/src/exports/middleware.tspackages/prisma-next/src/exports/migration.tspackages/prisma-next/src/exports/runtime.tspackages/prisma-next/src/middleware/bulk-encrypt.tspackages/prisma-next/src/stack/derive-schemas.tspackages/prisma-next/test/abort.test.tspackages/prisma-next/test/bulk-encrypt-middleware.test.tspackages/prisma-next/test/cipherstash-codec-numeric.test.tspackages/prisma-next/test/cipherstash-codec-other-codecs.test.tspackages/prisma-next/test/cipherstash-codec-string.test.tspackages/prisma-next/test/cipherstash-codec.test.tspackages/prisma-next/test/derive-schemas.test.tspackages/prisma-next/test/descriptor.test.tspackages/prisma-next/test/from-stack-divergence.test.tspackages/prisma-next/test/helpers.test.tspackages/prisma-next/test/operation-types.types.test-d.tspackages/prisma-next/test/operator-lowering-equality.test.tspackages/prisma-next/test/operator-lowering-text-search.test.tspackages/prisma-next/test/operator-lowering.helpers.tspackages/prisma-next/test/operator-lowering.test.tspackages/prisma-next/test/psl-interpretation-numeric.test.tspackages/prisma-next/test/psl-interpretation-other-types.test.tspackages/prisma-next/test/psl-interpretation.test.ts
💤 Files with no reviewable changes (4)
- examples/prisma/migrations/cipherstash/20260601T0000_install_eql_bundle/contract.json
- examples/prisma/migrations/app/20260513T1735_initial/end-contract.d.ts
- examples/prisma/migrations/app/20260513T1735_initial/migration.json
- examples/prisma/migrations/app/20260513T1735_initial/migration.ts
There was a problem hiding this comment.
Pull request overview
Upgrades the @cipherstash/prisma-next package (and the Prisma example) to Prisma Next 0.14.0, regenerating contract/migration artifacts and adapting runtime/tests/examples to Prisma Next’s newer contract/storage and adapter-lowering shapes (including namespace-qualified ORM access via public).
Changes:
- Bump all
@prisma-next/*deps used by@cipherstash/prisma-nextand the Prisma example to 0.14.0, regeneratingcontract.{json,d.ts}and baseline migration artifacts. - Update contract/table handling and tests for the namespace-enveloped storage IR and structured lowered params (
LoweredParam). - Update example code, docs, and E2E harness to use
db.orm.public.*andprisma-next migrate --yes.
Reviewed changes
Copilot reviewed 59 out of 69 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/prisma-next/test/psl-interpretation.test.ts | Updates PSL interpretation tests for namespace-enveloped storage IR + contract contracts map. |
| packages/prisma-next/test/psl-interpretation-other-types.test.ts | Same as above for non-string encrypted types. |
| packages/prisma-next/test/psl-interpretation-numeric.test.ts | Same as above for numeric encrypted types. |
| packages/prisma-next/test/operator-lowering.test.ts | Updates operator lowering assertions for structured lowered params. |
| packages/prisma-next/test/operator-lowering.helpers.ts | Switches contract validation + adds literalParamValue helper for LoweredParam. |
| packages/prisma-next/test/operator-lowering-text-search.test.ts | Updates text-search lowering assertions to unwrap literal params. |
| packages/prisma-next/test/operator-lowering-equality.test.ts | Updates equality lowering assertions to unwrap literal params. |
| packages/prisma-next/test/operation-types.types.test-d.ts | Adjusts @ts-expect-error placement to match dtslint expectations. |
| packages/prisma-next/test/helpers.test.ts | Updates helper tests for namespace-enveloped storage + structured params. |
| packages/prisma-next/test/from-stack-divergence.test.ts | Updates divergence tests for namespace-enveloped contract storage shape. |
| packages/prisma-next/test/descriptor.test.ts | Updates descriptor tests for namespace-enveloped storage + canonicalization hooks. |
| packages/prisma-next/test/derive-schemas.test.ts | Updates derive-schema tests for namespace-enveloped storage. |
| packages/prisma-next/test/cipherstash-codec.test.ts | Updates codec hook tests for new SqlStorage/namespace shapes and async op lowering. |
| packages/prisma-next/test/cipherstash-codec-string.test.ts | Adds namespaceId into codec hook test context. |
| packages/prisma-next/test/cipherstash-codec-other-codecs.test.ts | Adds namespaceId into codec hook test contexts for non-string codecs. |
| packages/prisma-next/test/cipherstash-codec-numeric.test.ts | Adds namespaceId into numeric codec hook test contexts. |
| packages/prisma-next/test/bulk-encrypt-middleware.test.ts | Updates middleware ctx construction to include planExecutionId. |
| packages/prisma-next/test/abort.test.ts | Updates middleware ctx construction to include planExecutionId. |
| packages/prisma-next/src/stack/derive-schemas.ts | Updates schema derivation to read tables from storage.namespaces[*].entries.table. |
| packages/prisma-next/src/middleware/bulk-encrypt.ts | Updates AST typing used by the bulk-encrypt routing-key stamping. |
| packages/prisma-next/src/exports/runtime.ts | Updates runtime wiring docs for Postgres runtime construction pattern. |
| packages/prisma-next/src/exports/migration.ts | Updates migration docs for Prisma Next 0.14 Migration instance methods. |
| packages/prisma-next/src/exports/middleware.ts | Updates middleware docs for Postgres runtime construction pattern. |
| packages/prisma-next/src/contract.json | Regenerated extension contract for Prisma Next 0.14 canonical shape. |
| packages/prisma-next/src/contract.d.ts | Regenerated extension contract typings for Prisma Next 0.14 canonical shape. |
| packages/prisma-next/README.md | Updates README examples to use db.orm.public.*. |
| packages/prisma-next/package.json | Pins @prisma-next/* dependencies/devDependencies to 0.14.0. |
| packages/prisma-next/migrations/refs/head.json | Updates baseline migration head hash for regenerated storage hash. |
| packages/prisma-next/migrations/20260601T0000_install_eql_bundle/ops.json | Formatting-only regen/normalization of ops JSON. |
| packages/prisma-next/migrations/20260601T0000_install_eql_bundle/migration.ts | Updates baseline migration “to” hash to the regenerated storage hash. |
| packages/prisma-next/migrations/20260601T0000_install_eql_bundle/migration.json | Regenerated migration metadata (hash + compacted shape). |
| packages/prisma-next/migrations/20260601T0000_install_eql_bundle/end-contract.json | Regenerated end-contract JSON to Prisma Next 0.14 canonical shape. |
| packages/prisma-next/migrations/20260601T0000_install_eql_bundle/end-contract.d.ts | Regenerated end-contract typings to Prisma Next 0.14 canonical shape. |
| examples/prisma/test/e2e/str-range.e2e.test.ts | Updates example E2E tests to use db.orm.public.*. |
| examples/prisma/test/e2e/README.md | Updates harness docs to use prisma-next migrate. |
| examples/prisma/test/e2e/num.e2e.test.ts | Updates example E2E tests to use db.orm.public.*. |
| examples/prisma/test/e2e/mixed.e2e.test.ts | Updates example E2E tests to use db.orm.public.*. |
| examples/prisma/test/e2e/json.e2e.test.ts | Updates example E2E tests to use db.orm.public.* / db.sql.public.*. |
| examples/prisma/test/e2e/global-setup.ts | Improves harness credential detection and switches to prisma-next migrate --yes. |
| examples/prisma/test/e2e/date.e2e.test.ts | Updates example E2E tests to use db.orm.public.*. |
| examples/prisma/test/e2e/bool.e2e.test.ts | Updates example E2E tests to use db.orm.public.*. |
| examples/prisma/test/e2e/bigint.e2e.test.ts | Updates example E2E tests to use db.orm.public.*. |
| examples/prisma/src/prisma/contract.json | Regenerated example app contract JSON to Prisma Next 0.14 canonical shape. |
| examples/prisma/src/prisma/contract.d.ts | Regenerated example app contract typings to Prisma Next 0.14 canonical shape. |
| examples/prisma/src/index.ts | Updates example runtime code to use db.orm.public.*. |
| examples/prisma/README.md | Updates ports and migration command docs for Prisma Next 0.14 workflow. |
| examples/prisma/prisma-next.config.ts | Updates prismaContract target arg to use the target pack. |
| examples/prisma/package.json | Pins example dependencies to Prisma Next 0.14 and switches to prisma-next migrate --yes. |
| examples/prisma/migrations/cipherstash/refs/head.json | Updates baseline ref head hash (formatting + new hash). |
| examples/prisma/migrations/cipherstash/contract.json | Regenerated/minified baseline contract JSON in new canonical shape. |
| examples/prisma/migrations/cipherstash/contract.d.ts | Updates guidance comment for contract consumption under 0.14. |
| examples/prisma/migrations/cipherstash/20260601T0000_install_eql_bundle/ops.json | Formatting-only regen/normalization of ops JSON. |
| examples/prisma/migrations/cipherstash/20260601T0000_install_eql_bundle/migration.json | Regenerated migration metadata (hash + compacted shape). |
| examples/prisma/migrations/cipherstash/20260601T0000_install_eql_bundle/contract.json | Removes older per-migration embedded contract (deleted). |
| examples/prisma/migrations/app/20260709T1034_initial/ops.json | Regenerates migration checks to use parameterized SQL. |
| examples/prisma/migrations/app/20260709T1034_initial/migration.ts | New app migration using Prisma Next 0.14 migration APIs. |
| examples/prisma/migrations/app/20260709T1034_initial/migration.json | New compact migration metadata for the regenerated app migration. |
| examples/prisma/migrations/app/20260709T1034_initial/end-contract.json | Regenerated end-contract JSON to Prisma Next 0.14 canonical shape. |
| examples/prisma/migrations/app/20260709T1034_initial/end-contract.d.ts | New regenerated end-contract typings to Prisma Next 0.14 canonical shape. |
| examples/prisma/migrations/app/20260513T1735_initial/migration.ts | Removes older app migration using deprecated factory APIs (deleted). |
| examples/prisma/migrations/app/20260513T1735_initial/migration.json | Removes older verbose migration JSON (deleted). |
| examples/prisma/migrations/app/20260513T1735_initial/end-contract.d.ts | Removes older end-contract typings (deleted). |
| examples/prisma/docker-compose.yml | Updates example Postgres port to 54338 and aligns docs. |
| examples/prisma/.env.example | Updates DATABASE_URL to match new example Postgres port. |
| e2e/tests/prisma-example-readme.e2e.test.ts | Improves auth detection (auth.json/device.json) and preserves .env across README walkthrough. |
| .changeset/prisma-next-0-14.md | Adds changeset documenting the Prisma Next 0.14 upgrade and key behavior changes. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!namespaces) return [] | ||
| const tables: Record<string, StorageTableView> = {} | ||
| for (const namespace of Object.values(namespaces)) { | ||
| Object.assign(tables, namespace.entries?.table) |
| } | ||
| const tables: StorageView['tables'] = {} | ||
| for (const ns of Object.values(s.namespaces ?? {})) { | ||
| Object.assign(tables, ns.entries?.table) |
| } | ||
| const tables: StorageView['tables'] = {} | ||
| for (const ns of Object.values(s.namespaces ?? {})) { | ||
| Object.assign(tables, ns.entries?.table) |
| } | ||
| const tables: StorageView['tables'] = {} | ||
| for (const ns of Object.values(s.namespaces ?? {})) { | ||
| Object.assign(tables, ns.entries?.table) |
| // CipherStash profile written by `stash auth login` (device-code flow; | ||
| // `~/.cipherstash`). The stack client resolves both — this gate only | ||
| // exists to fail fast with an actionable message when neither is present. | ||
| const hasProfile = existsSync(join(homedir(), '.cipherstash')) |
Code review: Prisma Next 0.14 upgradeReviewed the hand-written source in this branch (generated contracts, migrations, and the lockfile excluded). 15 findings below, most severe first. A note on method: I verified the 0.14 API claims against the published tarballs rather than the working tree, because 1.
|
Summary by CodeRabbit
New Features
publicschema in ORM access paths.Bug Fixes
Documentation