TML-3061: PostgreSQL and SQLite codec descriptor protocols#1051
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR adds target-owned PostgreSQL and SQLite codec descriptor protocols and registries, rewires runtime/control adapters to use composed descriptor registries, migrates built-in and extension codecs, and documents authoring and upgrade paths. ChangesDescriptor contracts and built-ins
Adapter composition
Extension and authoring updates
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
@prisma-next/extension-author-tools
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/extension-supabase
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/cli-telemetry
@prisma-next/config-loader
@prisma-next/emitter
@prisma-next/language-server
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
size-limit report 📦
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/3-targets/3-targets/sqlite/test/typed-descriptor-flow.test-d.ts (1)
5-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winImport
AnySqliteCodecDescriptorfrom the public exports surface, not core.This file imports
AnySqliteCodecDescriptorfrom../src/core/codec-descriptor, but the type is already re-exported from../src/exports/codec-descriptor(used by the sibling test filessqlite-codec-descriptor.test.ts/.test-d.ts). Importing from core bypasses the package's intended public API boundary.♻️ Suggested fix
-import type { AnySqliteCodecDescriptor } from '../src/core/codec-descriptor'; +import type { AnySqliteCodecDescriptor } from '../src/exports/codec-descriptor';Based on learnings, "treat files there as explicit public API export surfaces rather than internal barrels... ensure the exports in src/exports accurately represent the public API."
🤖 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/3-targets/3-targets/sqlite/test/typed-descriptor-flow.test-d.ts` around lines 5 - 15, Update the AnySqliteCodecDescriptor import in the typed descriptor flow test to use the public export from ../src/exports/codec-descriptor instead of the internal ../src/core/codec-descriptor module, while leaving the other imports unchanged.Source: Learnings
packages/3-targets/3-targets/postgres/src/core/codecs.ts (1)
191-197: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: consider a shared identity
jsonProjectionto cut repetition.The identical
jsonProjection(expression) { return expression; }override is repeated across ~25 scalar descriptor classes. If the intent is a per-codec authoring decision, keeping it explicit is fine; otherwise a default identity implementation onPostgresCodecDescriptor(or reusing the module-levelidentityJsonProjection) would remove the boilerplate while keeping array/custom projections overridable.🤖 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/3-targets/3-targets/postgres/src/core/codecs.ts` around lines 191 - 197, Optionally remove the repeated identity jsonProjection override from scalar descriptor classes such as PgTextDescriptor by providing the default identity implementation on PostgresCodecDescriptor or reusing identityJsonProjection. Preserve explicit overrides for array or custom projection descriptors.
🤖 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 `@packages/3-targets/3-targets/postgres/src/core/codecs.ts`:
- Around line 191-197: Optionally remove the repeated identity jsonProjection
override from scalar descriptor classes such as PgTextDescriptor by providing
the default identity implementation on PostgresCodecDescriptor or reusing
identityJsonProjection. Preserve explicit overrides for array or custom
projection descriptors.
In `@packages/3-targets/3-targets/sqlite/test/typed-descriptor-flow.test-d.ts`:
- Around line 5-15: Update the AnySqliteCodecDescriptor import in the typed
descriptor flow test to use the public export from
../src/exports/codec-descriptor instead of the internal
../src/core/codec-descriptor module, while leaving the other imports unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0f4d3ebb-9c7f-45e9-9ccd-9c48b289bccf
⛔ Files ignored due to path filters (17)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlprojects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/01-postgres-descriptor-protocol-round-2.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/01-postgres-descriptor-protocol.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/02-sqlite-descriptor-protocol.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/03-postgres-built-in-adoption.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/04-sqlite-built-in-adoption.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/05-postgres-extension-adoption.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/06-postgres-adapter-composition-round-2.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/06-postgres-adapter-composition.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/07-sqlite-adapter-composition.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/08-authoring-docs-and-upgrade-instructions-round-2.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/08-authoring-docs-and-upgrade-instructions-round-3.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/08-authoring-docs-and-upgrade-instructions.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/dispatches/09-preservation-audit-and-slice-gate.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/plan.mdis excluded by!projects/**projects/codec-json-projections/slices/02-target-codec-descriptor-foundations/spec.mdis excluded by!projects/**projects/codec-json-projections/trace.jsonlis excluded by!projects/**
📒 Files selected for processing (80)
docs/reference/codec-authoring-guide.mdpackages/2-sql/2-authoring/contract-ts/src/contract-types.tspackages/3-extensions/arktype-json/package.jsonpackages/3-extensions/arktype-json/src/core/arktype-json-codec.tspackages/3-extensions/arktype-json/test/postgres-codec-descriptor-adoption.test-d.tspackages/3-extensions/arktype-json/test/postgres-codec-descriptor-adoption.test.tspackages/3-extensions/pgvector/package.jsonpackages/3-extensions/pgvector/src/core/codecs.tspackages/3-extensions/pgvector/test/contract-declaration-portability.fixture.tspackages/3-extensions/pgvector/test/contract-declaration-portability.test-d.tspackages/3-extensions/pgvector/test/control-adapter-lower-parity.test.tspackages/3-extensions/pgvector/test/operation-lowering.test.tspackages/3-extensions/pgvector/test/operations.test.tspackages/3-extensions/pgvector/test/postgres-codec-descriptor-adoption.test-d.tspackages/3-extensions/pgvector/test/postgres-codec-descriptor-adoption.test.tspackages/3-extensions/pgvector/test/rich-adapter.test.tspackages/3-extensions/pgvector/test/sql-renderer.cast-policy.test.tspackages/3-extensions/pgvector/test/typed-descriptor-flow.test-d.tspackages/3-extensions/postgis/package.jsonpackages/3-extensions/postgis/src/core/codecs.tspackages/3-extensions/postgis/test/postgres-codec-descriptor-adoption.test-d.tspackages/3-extensions/postgis/test/postgres-codec-descriptor-adoption.test.tspackages/3-targets/3-targets/postgres/README.mdpackages/3-targets/3-targets/postgres/package.jsonpackages/3-targets/3-targets/postgres/src/core/codec-descriptor.tspackages/3-targets/3-targets/postgres/src/core/codec-type-map.tspackages/3-targets/3-targets/postgres/src/core/codecs.tspackages/3-targets/3-targets/postgres/src/core/registry.tspackages/3-targets/3-targets/postgres/src/exports/codec-descriptor.tspackages/3-targets/3-targets/postgres/src/exports/codecs.tspackages/3-targets/3-targets/postgres/test/postgres-built-in-codec-descriptors.test-d.tspackages/3-targets/3-targets/postgres/test/postgres-built-in-codec-descriptors.test.tspackages/3-targets/3-targets/postgres/test/postgres-codec-descriptor.test-d.tspackages/3-targets/3-targets/postgres/test/postgres-codec-descriptor.test.tspackages/3-targets/3-targets/postgres/test/typed-descriptor-flow.test-d.tspackages/3-targets/3-targets/postgres/tsdown.config.tspackages/3-targets/3-targets/sqlite/README.mdpackages/3-targets/3-targets/sqlite/package.jsonpackages/3-targets/3-targets/sqlite/src/core/codec-descriptor.tspackages/3-targets/3-targets/sqlite/src/core/codecs.tspackages/3-targets/3-targets/sqlite/src/core/registry.tspackages/3-targets/3-targets/sqlite/src/exports/codec-descriptor.tspackages/3-targets/3-targets/sqlite/src/exports/codec-types.tspackages/3-targets/3-targets/sqlite/src/exports/codecs.tspackages/3-targets/3-targets/sqlite/test/sqlite-built-in-codec-descriptors.test-d.tspackages/3-targets/3-targets/sqlite/test/sqlite-built-in-codec-descriptors.test.tspackages/3-targets/3-targets/sqlite/test/sqlite-codec-descriptor.test-d.tspackages/3-targets/3-targets/sqlite/test/sqlite-codec-descriptor.test.tspackages/3-targets/3-targets/sqlite/test/typed-descriptor-flow.test-d.tspackages/3-targets/3-targets/sqlite/tsdown.config.tspackages/3-targets/6-adapters/postgres/README.mdpackages/3-targets/6-adapters/postgres/src/core/adapter.tspackages/3-targets/6-adapters/postgres/src/core/codec-lookup.tspackages/3-targets/6-adapters/postgres/src/core/control-adapter.tspackages/3-targets/6-adapters/postgres/src/core/sql-renderer.tspackages/3-targets/6-adapters/postgres/src/core/types.tspackages/3-targets/6-adapters/postgres/src/exports/control.tspackages/3-targets/6-adapters/postgres/src/exports/runtime.tspackages/3-targets/6-adapters/postgres/src/exports/types.tspackages/3-targets/6-adapters/postgres/test/lower-to-execute-request.test.tspackages/3-targets/6-adapters/postgres/test/migrations/data-transform.test.tspackages/3-targets/6-adapters/postgres/test/postgres-adapter-options.test-d.tspackages/3-targets/6-adapters/postgres/test/postgres-codec-registry-composition.test.tspackages/3-targets/6-adapters/postgres/test/raw-expr-lowering.test.tspackages/3-targets/6-adapters/postgres/test/sql-renderer-namespace-qualification.test.tspackages/3-targets/6-adapters/postgres/test/sql-renderer.cast-policy.test.tspackages/3-targets/6-adapters/sqlite/README.mdpackages/3-targets/6-adapters/sqlite/src/core/adapter.tspackages/3-targets/6-adapters/sqlite/src/core/codec-lookup.tspackages/3-targets/6-adapters/sqlite/src/core/control-adapter.tspackages/3-targets/6-adapters/sqlite/src/core/runtime-adapter.tspackages/3-targets/6-adapters/sqlite/src/core/types.tspackages/3-targets/6-adapters/sqlite/src/exports/adapter.tspackages/3-targets/6-adapters/sqlite/src/exports/control.tspackages/3-targets/6-adapters/sqlite/src/exports/types.tspackages/3-targets/6-adapters/sqlite/test/lower-to-execute-request.test.tspackages/3-targets/6-adapters/sqlite/test/sqlite-adapter-options.test-d.tspackages/3-targets/6-adapters/sqlite/test/sqlite-codec-registry-composition.test.tspackages/3-targets/6-adapters/sqlite/test/verification-checks-lowering.test.tsskills/extension-author/prisma-next-extension-upgrade/upgrades/0.16-to-0.17/instructions.md
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
SqliteControlAdapter takes a SqliteCodecRegistry, so the structured-error DDL test composes its stub over createSqliteBuiltinCodecLookup() and overrides only get(). The DDL default-rendering path reads codecs through get() alone, so the exercised behavior is unchanged. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
5640544 to
6690e02
Compare
|
Triaged both CodeRabbit nitpicks from this review. Verified each against the current tree (post-rebase); declining both, with reasons. 1. The factual half checks out: the type is re-exported from The cited precedent is also a partial sample — within this package 3 of 5 descriptor tests import the type from 2. Identity
The published 0.16→0.17 upgrade instructions bind downstream extension authors to the same contract ("add |
The codec-ref helpers in the target descriptor tests hand-rolled the conditional property spread for the optional `typeParams` and `many` fields. `ifDefined` from `@prisma-next/utils/defined` expresses the same thing directly, per .agents/rules/use-if-defined.mdc. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@docs/reference/codec-authoring-guide.md`:
- Around line 110-116: Add the missing imports in the Case 2 and Case 3 examples
for the PostgreSQL descriptor value used by PgVectorDescriptor and the
ProjectionExpr type used by nativeType/jsonProjection signatures. Keep the
examples otherwise unchanged so both code blocks are copyable and
type-checkable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e8a834b-dce2-40bd-8f66-0c40eaec098a
📒 Files selected for processing (11)
docs/reference/codec-authoring-guide.mdpackages/2-sql/2-authoring/contract-ts/src/contract-types.tspackages/3-extensions/arktype-json/package.jsonpackages/3-extensions/arktype-json/src/core/arktype-json-codec.tspackages/3-extensions/arktype-json/test/postgres-codec-descriptor-adoption.test-d.tspackages/3-extensions/arktype-json/test/postgres-codec-descriptor-adoption.test.tspackages/3-extensions/pgvector/package.jsonpackages/3-extensions/pgvector/src/core/codecs.tspackages/3-extensions/pgvector/test/contract-declaration-portability.fixture.tspackages/3-extensions/pgvector/test/contract-declaration-portability.test-d.tspackages/3-extensions/pgvector/test/control-adapter-lower-parity.test.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- packages/3-extensions/pgvector/test/contract-declaration-portability.fixture.ts
- packages/3-extensions/pgvector/test/control-adapter-lower-parity.test.ts
- packages/3-extensions/arktype-json/test/postgres-codec-descriptor-adoption.test.ts
- packages/3-extensions/arktype-json/package.json
- packages/3-extensions/arktype-json/test/postgres-codec-descriptor-adoption.test-d.ts
- packages/2-sql/2-authoring/contract-ts/src/contract-types.ts
- packages/3-extensions/pgvector/src/core/codecs.ts
- packages/3-extensions/pgvector/package.json
- packages/3-extensions/arktype-json/src/core/arktype-json-codec.ts
The case-study blocks are descriptor-shape excerpts, not complete files: Case 1 carries the full framework import block, Cases 2 and 3 list only what each adds, and all three elide the pack own internals. Say so, so the blocks are not read as copyable modules. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Linked issue
Refs TML-3061
Base:
main. Predecessor #1023 is merged, so this PR has no stacked-base prerequisite.At a glance
A PostgreSQL descriptor now accepts the generic
CodecRefthat survives framework composition, validates its erased parameters, and enters target-owned typed behavior only after validation.Decision
This PR ships the public PostgreSQL and SQLite codec descriptor protocols that the lossless JSON projection work will execute through: explicit generic-to-target adapters, narrow authoring helpers, structurally validated immutable registries, and coherent runtime/control adapter composition. It migrates every affected built-in and the pgvector, PostGIS, and arktype-json extensions to those protocols, moves PostgreSQL native-type lookup behind the validated descriptor boundary, and adds the
PublicCodecTypesdeclaration-portability boundary plus extension-author migration guidance.Reviewer notes
PublicCodecTypesintentionally exposes only each codec'sinput,output, andtraitsthrough composed contract declarations. This keeps downstream semantic typing exact without making exported declarations name concrete target descriptor implementation members.codecDescriptors.How it fits together
PostgresCodecDescriptorandSqliteCodecDescriptoradd stable structural discriminants and public template methods. Each template method validates erasedCodecRef.typeParamsthrough the descriptor's Standard Schema before calling a strongly typed target hook.postgresCodec(...),sqliteCodec(...),definePostgresCodecs(...), anddefineSqliteCodecs(...)make target ownership explicit while preserving generic SQL descriptor IDs, traits, parameter schemas, factories, renderers, metadata, and literal types. PostgreSQL supplies native-type plus scalar/array projection capabilities; SQLite supplies scalar projection and reports unsupported stored scalar-array refs.nativeTypeFor(ref)on the validated descriptor. Runtime, control, custom, enum, extension, and array cast spellings remain pinned to their existing SQL.PublicCodecTypesprojects extension codec maps to their public semantic fields before they enter contract types. Consumer declarations retain exact application types and traits while staying portable across package boundaries.skills/extension-author/prisma-next-extension-upgrade/upgrades/0.16-to-0.17/document target-owned authoring, coherent contribution sets, parameter-ref audits, and the dormant-hook transition.Behavior changes & evidence
CodecRef.many. Implementation: PostgreSQL descriptor protocol, SQLite descriptor protocol. Evidence: PostgreSQL descriptor tests, SQLite descriptor tests.PublicCodecTypes. Evidence: declaration fixture, declaration type test.Compatibility / migration / risk
PostgresCodecDescriptoror usepostgresCodec(...), define target behavior, contribute adefinePostgresCodecs(...)set through runtime and control paths, and declare@prisma-next/target-postgresas a production dependency.codecDescriptorsin place of an independently assembled genericcodecLookup; SQLite gains the equivalent target-typed option.PublicCodecTypesnarrows incidental descriptor-derived members out of exported contract types while preservinginput,output, andtraits. Consumers depending on incidental implementation members through contract types must move to the descriptor API.Testing performed
Passed on the final branch state:
pnpm buildandpnpm typecheck.PublicCodecTypesdeclaration portability.pnpm lint:deps;pnpm lint:casts;pnpm lint:throws;pnpm check:upgrade-coverage --mode pr;pnpm fixtures:check; and the bounded closing audits.Run, with final broad confirmation deferred to CI:
pnpm test:packagespnpm test:integrationpnpm test:e2ePostgres/resource-related flakes remained after reruns at varying and focused scopes. These three broad suites are recorded as executed, not as passing.
Skill update
Updated the codec authoring documentation and the extension-author upgrade instructions in
skills/extension-author/prisma-next-extension-upgrade/upgrades/0.16-to-0.17/. The upgrade entry detects generic PostgreSQL extension descriptors and walks authors through runtime dependency placement, target subclassing or adaptation, canonical runtime/control contribution sets, requiredCodecRef.typeParams, and behavior-preservation checks.Follow-ups
Alternatives considered
CodecMetaor add a framework-owned target map. Rejected because target SQL/JSON behavior is open-world and belongs to each target package; generic framework composition remains target-neutral.instanceof. Rejected because extensions may load a separate copy of a target package. Stable structural discriminants and required methods preserve interoperability across module identities.Checklist
git commit -s) per the DCO.TML-NNNN: <sentence-case title>form and names the concrete deliverable.Summary by CodeRabbit