Skip to content

feat: add explicit JSON projection AST foundations (TML-3062) - #1023

Merged
aqrln merged 31 commits into
mainfrom
tml-3062-sql-json-projection-ast-foundations
Jul 22, 2026
Merged

feat: add explicit JSON projection AST foundations (TML-3062)#1023
aqrln merged 31 commits into
mainfrom
tml-3062-sql-json-projection-ast-foundations

Conversation

@tensordreams

@tensordreams tensordreams commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Refs TML-3062

Prerequisite #1013 merged the project plan; this PR targets main, not the deleted planning branch.

At a glance

const visitor: JsonValueProjectionVisitor<string> = {
  codec: ({ value }) => renderExpr(value, contract, pim),
  native: ({ value }) => renderExpr(value, contract, pim),
  document: ({ value }) => renderExpr(value, contract, pim),
};

Previously JSON containers accepted bare expressions and could not preserve whether a value represented codec-projected data, a native scalar, or an existing JSON document.

Decision

This PR ships the target-neutral SQL JSON projection AST foundations described in the slice spec:

  1. A frozen, exhaustive projection algebra with codec, native, and document variants, plus explicit projection values at every JSON object and array boundary.
  2. Typed scalar function, cast, searched-CASE, returned-column-alias, and ordinality nodes needed by later target projection algorithms.
  3. Authoritative ProjectionItem.codec forwarding through SQL ORM projection wrappers, including row-number dedup.

The PostgreSQL and SQLite renderers consume the new vocabulary now, while executable codec/document projection semantics remain in later slices.

Reviewer notes

  • The largest semantic surface is the relational AST expansion in types.ts and its focused tests. The projection algebra itself is isolated in json-value-projection.ts.
  • All three projection visitor arms intentionally render their wrapped expressions unchanged in this foundation PR. Target descriptor lookup and target-owned codec/document transforms are follow-up work.
  • Direct relational-AST consumers must now wrap JSON object values and array elements explicitly. The repository call sites use NativeJsonValueProjection; there is no compatibility overload.
  • The project slice spec, dispatch plan, briefs, and trace remain tracked for review and later project close-out.
  • All actionable branch-local checks and closing scans pass. The exact full runs pnpm --filter @prisma-next/adapter-postgres test and pnpm test:packages did not pass locally: repeated attempts rotated among connection resets, timeouts, and connection-termination failures. A freshly installed and built pristine origin/main worktree reproduced the same failure family. The operator accepted this baseline validation deferral, and CI is authoritative for those full runs.

How it fits together

  1. The projection algebra gives each JSON value a frozen class identity, exhaustive visitor dispatch, expression traversal, and complete immutable codec metadata.
  2. JSON container nodes require those projection classes, and the PostgreSQL and SQLite renderers visit them as structural pass-throughs so current native JSON SQL remains unchanged.
  3. The relational AST adds composable function calls, casts, searched CASE expressions, function-source column aliases, and ordinality; each node participates in freezing, rewriting, folding, reference collection, exhaustive visitors, and both dialect renderers.
  4. SQL ORM projection wrappers forward complete output codec metadata when values cross derived-table boundaries, preserving the information later decoding and target projection work consume.

Behavior changes & evidence

Compatibility / migration / risk

  • This is a deliberate breaking change for direct consumers of the low-level relational AST: wrap existing JSON object/array expressions in the appropriate projection class.
  • Existing repository-produced native JSON queries retain their SQL and result behavior because current renderer visitors are structural pass-throughs.
  • Existing FunctionSource.of(fn, args, alias?) callers must replace a string alias with the grouped { alias, columnAliases? } option; calls that omit the alias remain unchanged. PostgreSQL supports the new ordinality and returned-column-alias options; SQLite rejects those unsupported options with explicit errors.
  • Executable codec/document transforms, target descriptor lookup, canonical codec JSON changes, aggregate decoding, and fixtures remain later work; this PR records the required extension-author migrations under skills/extension-author/prisma-next-extension-upgrade/upgrades/0.16-to-0.17/.

Testing performed

Passed on the final rebased branch:

  • pnpm --filter @prisma-next/sql-relational-core build
  • pnpm --filter @prisma-next/sql-relational-core test
  • pnpm --filter @prisma-next/sql-relational-core typecheck
  • pnpm --filter @prisma-next/sql-relational-core lint
  • pnpm --filter @prisma-next/adapter-postgres typecheck
  • pnpm --filter @prisma-next/adapter-postgres lint
  • pnpm --filter @prisma-next/adapter-sqlite test
  • pnpm --filter @prisma-next/adapter-sqlite typecheck
  • pnpm --filter @prisma-next/adapter-sqlite lint
  • pnpm --filter @prisma-next/sql-orm-client test
  • pnpm --filter @prisma-next/sql-orm-client typecheck
  • pnpm --filter @prisma-next/sql-orm-client lint
  • pnpm lint:casts
  • pnpm lint:deps
  • pnpm typecheck
  • Focused affected PostgreSQL suites and the post-rebase where-binding regression
  • Closing scope, cast, transient-ID, fixture, contract, prototype, project-path, and git diff --check scans

Accepted baseline validation deferral; these full runs are not claimed as passing:

  • pnpm --filter @prisma-next/adapter-postgres test
  • pnpm test:packages

Both full-run paths repeatedly rotated among connection resets, timeouts, and connection-termination failures; a freshly installed and built pristine origin/main reproduced the same failure family. The operator accepted the baseline deferral, and CI is authoritative.

Skill update

Adds the adopt-sql-json-projection-ast-foundations extension-author upgrade entry under skills/extension-author/prisma-next-extension-upgrade/upgrades/0.16-to-0.17/. It covers explicit JSON value-projection wrappers, the new function/cast/case visitor variants, grouped FunctionSource alias arguments, and codec-preserving forwarded projections; the migration is prose-only because each handler and projection policy requires extension-specific reasoning.

Follow-ups

  • TML-3061 adds target descriptor classes, factories, and registries.
  • TML-3063 adds target-owned codec/document projection execution and array lifting.
  • TML-3064 completes aggregate behavior, public testkits, fixtures, documentation, and upgrade guidance.

Alternatives considered

  • Continue accepting bare expressions and infer native semantics. Rejected because every future projection site must state codec, native, or document intent explicitly.
  • Use raw SQL or add a general SQL grammar for projection transforms. Rejected in favor of the minimal typed function, cast, searched-CASE, and function-source vocabulary required by the selected algorithms.
  • Execute codec/document projections in this PR. Rejected because target-owned descriptors and registries are separate prerequisites; this slice keeps all three renderer arms as deliberate pass-throughs.
  • Recover codecs from table/column lineage after wrapping. Rejected because projected-result codec metadata is authoritative and must survive query-plan reconstruction directly.

Checklist

  • All commits are signed off (git commit -s) per the DCO.
  • I read CONTRIBUTING.md and the change is scoped to one logical concern.
  • Tests are updated.
  • The PR title is in TML-NNNN: <sentence-case title> form.
  • The Skill update section above is filled in.

Summary by CodeRabbit

  • New Features

    • Added support for function calls, casts, and CASE expressions in SQL query construction and rendering.
    • Added JSON value projection types for native, codec-backed, and document values.
    • Added function-source options for column aliases and WITH ORDINALITY.
  • Bug Fixes

    • Improved JSON aggregation and object rendering while preserving codec information.
    • Improved SQL expression precedence and null-check handling.
    • Added clearer validation for unsupported grouped filtering expressions and SQLite features.

@tensordreams
tensordreams requested a review from a team as a code owner July 21, 2026 17:53
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds typed JSON value projection nodes, new function-call/cast/CASE AST expressions, function-source ordinality and column aliases, ORM binding and query-plan updates, and PostgreSQL/SQLite rendering and validation for these constructs.

Changes

AST and JSON projection contracts

Layer / File(s) Summary
Typed JSON projection algebra
packages/2-sql/4-lanes/relational-core/src/ast/*, packages/2-sql/4-lanes/relational-core/test/ast/*
Adds codec, native, and document JSON projections with frozen values, visitor dispatch, rewriting, traversal, and explicit JSON container typing.
Scalar expressions and function sources
packages/2-sql/4-lanes/relational-core/src/ast/types.ts, packages/2-sql/4-lanes/relational-core/test/ast/*, packages/2-sql/4-lanes/relational-core/test/contract-free/*
Adds function-call, cast, and CASE expressions and adds validated ordinality and column-alias options to FunctionSource.
Query-plan projection and binding integration
packages/3-extensions/sql-orm-client/src/*, packages/3-extensions/sql-orm-client/test/*, packages/3-extensions/pgvector/test/*, test/integration/test/sql-orm-client/*
Wraps JSON values in native projections, preserves codecs through deduplication, binds new expression nodes, and rejects unsupported grouped HAVING expressions.
PostgreSQL and SQLite rendering
packages/3-targets/6-adapters/{postgres,sqlite}/src/*, packages/3-targets/6-adapters/{postgres,sqlite}/test/*
Renders new scalar expressions and JSON projection variants, supports PostgreSQL function-source options, rejects unsupported SQLite options, and validates SQL precedence and atomicity.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant QueryPlanSelect
  participant RelationalAST
  participant SQLRenderer
  QueryPlanSelect->>RelationalAST: build JSON object and array projections
  RelationalAST->>SQLRenderer: render JSON value projections and scalar expressions
  SQLRenderer-->>QueryPlanSelect: emit PostgreSQL or SQLite SQL
Loading

Suggested reviewers: sevinf, wmadden

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.02% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding explicit JSON projection AST foundations.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tml-3062-sql-json-projection-ast-foundations

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/2-sql/4-lanes/relational-core/src/ast/types.ts (1)

110-117: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Deep-freeze typeParams here too. structuredClone(codec.typeParams) still leaves nested JSON mutable, so mirror json-value-projection.ts and recurse before freezing the wrapper.

🤖 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/2-sql/4-lanes/relational-core/src/ast/types.ts` around lines 110 -
117, Update frozenCodecRef to deep-freeze the cloned codec.typeParams
recursively before constructing the frozen wrapper, following the established
approach in json-value-projection.ts. Preserve the existing handling of
undefined typeParams and the many flag while ensuring nested JSON values cannot
be mutated.
🧹 Nitpick comments (2)
packages/3-extensions/sql-orm-client/test/where-binding.test.ts (1)

405-409: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Split the combined toMatchObject assertion into separate expect() calls.

Bundling kind, value, and codec checks into one toMatchObject obscures which field fails on a regression.

Based on a retrieved learning: "prefer separate expect() assertions for each field instead of combining checks with toMatchObject() when validating multiple fields... clearer, more actionable failure messages."

♻️ Proposed refactor
-      expect(innerWhere.right).toMatchObject({
-        kind: 'param-ref',
-        value: 100,
-        codec: { codecId: 'pg/int4@1' },
-      });
+      expect(innerWhere.right.kind).toBe('param-ref');
+      expect((innerWhere.right as ParamRef).value).toBe(100);
+      expect((innerWhere.right as ParamRef).codec).toEqual({ codecId: 'pg/int4@1' });
🤖 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-extensions/sql-orm-client/test/where-binding.test.ts` around lines
405 - 409, Split the toMatchObject assertion for innerWhere.right into separate
expect() calls, validating kind, value, and codec independently. Preserve the
existing expected values and codecId while making each field failure
independently identifiable.

Source: Learnings

packages/3-targets/6-adapters/postgres/src/core/sql-renderer.ts (1)

129-140: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate "unreachable kind" introspection logic across the Postgres and SQLite adapters. Both files independently implement the same "read kind off an unknown/unreachable AST node" helper for building unsupported-node error messages; the shared root cause is the lack of a common utility in the relational-core AST package.

  • packages/3-targets/6-adapters/postgres/src/core/sql-renderer.ts#L129-L140: replace the inline unreachableKind body with an import of a shared describeUnreachableKind/unreachableKind helper exported from @prisma-next/sql-relational-core/ast (or a small shared adapter-utils module).
  • packages/3-targets/6-adapters/sqlite/src/core/adapter.ts#L48-L62: drop the local nodeKind/unreachableKind pair and import the same shared helper, keeping both adapters' unsupported-kind error formatting in sync as more SQL targets are added.
🤖 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/6-adapters/postgres/src/core/sql-renderer.ts` around lines
129 - 140, Extract the shared unreachable-AST-node kind inspection into a
relational-core AST utility and import it in both adapters. In
packages/3-targets/6-adapters/postgres/src/core/sql-renderer.ts:129-140, replace
unreachableKind’s inline logic with the shared helper; in
packages/3-targets/6-adapters/sqlite/src/core/adapter.ts:48-62, remove the local
nodeKind/unreachableKind pair and use the same helper while preserving
unsupported-kind error formatting.
🤖 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 `@packages/2-sql/4-lanes/relational-core/src/ast/json-value-projection.ts`:
- Around line 33-44: Extract the deep-freezing, explicit-many-preserving
frozenCodecRef implementation from
packages/2-sql/4-lanes/relational-core/src/ast/json-value-projection.ts lines
33-44 into a shared helper alongside CodecRef in
packages/2-sql/4-lanes/relational-core/src/ast/codec-types.ts, then import and
use it from both locations. Replace the duplicate implementation in
packages/2-sql/4-lanes/relational-core/src/ast/types.ts lines 110-117 with the
shared helper, preserving deep-frozen typeParams and many: false.

---

Outside diff comments:
In `@packages/2-sql/4-lanes/relational-core/src/ast/types.ts`:
- Around line 110-117: Update frozenCodecRef to deep-freeze the cloned
codec.typeParams recursively before constructing the frozen wrapper, following
the established approach in json-value-projection.ts. Preserve the existing
handling of undefined typeParams and the many flag while ensuring nested JSON
values cannot be mutated.

---

Nitpick comments:
In `@packages/3-extensions/sql-orm-client/test/where-binding.test.ts`:
- Around line 405-409: Split the toMatchObject assertion for innerWhere.right
into separate expect() calls, validating kind, value, and codec independently.
Preserve the existing expected values and codecId while making each field
failure independently identifiable.

In `@packages/3-targets/6-adapters/postgres/src/core/sql-renderer.ts`:
- Around line 129-140: Extract the shared unreachable-AST-node kind inspection
into a relational-core AST utility and import it in both adapters. In
packages/3-targets/6-adapters/postgres/src/core/sql-renderer.ts:129-140, replace
unreachableKind’s inline logic with the shared helper; in
packages/3-targets/6-adapters/sqlite/src/core/adapter.ts:48-62, remove the local
nodeKind/unreachableKind pair and use the same helper while preserving
unsupported-kind error formatting.
🪄 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

Run ID: 456633a7-efe6-4d2f-8aa5-0e2ccd526d97

📥 Commits

Reviewing files that changed from the base of the PR and between 562aec1 and 19730c4.

⛔ Files ignored due to path filters (10)
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/dispatches/01-projection-algebra.md is excluded by !projects/**
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/dispatches/02-explicit-json-container-adoption.md is excluded by !projects/**
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/dispatches/03-scalar-projection-expressions.md is excluded by !projects/**
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/dispatches/04-function-source-ordinality-round-2.md is excluded by !projects/**
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/dispatches/04-function-source-ordinality.md is excluded by !projects/**
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/dispatches/05-projected-codec-preservation-and-slice-gate.md is excluded by !projects/**
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/dispatches/06-post-rebase-lint-compatibility.md is excluded by !projects/**
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/plan.md is excluded by !projects/**
  • projects/codec-json-projections/slices/01-sql-json-projection-ast-foundations/spec.md is excluded by !projects/**
  • projects/codec-json-projections/trace.jsonl is excluded by !projects/**
📒 Files selected for processing (30)
  • packages/2-sql/4-lanes/relational-core/src/ast/json-value-projection.ts
  • packages/2-sql/4-lanes/relational-core/src/ast/types.ts
  • packages/2-sql/4-lanes/relational-core/src/exports/ast.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/common.test.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/json-container-projection.test-d.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/json-container-projection.test.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/json-value-projection.test.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/kind-discriminants.test.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/raw-expr.test.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/rich-ast.test.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/scalar-projection-expressions.test.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/select.test.ts
  • packages/2-sql/4-lanes/relational-core/test/ast/visitors.test.ts
  • packages/2-sql/4-lanes/relational-core/test/contract-free/expr-select.test.ts
  • packages/3-extensions/pgvector/test/rich-adapter.test.ts
  • packages/3-extensions/sql-orm-client/src/query-plan-aggregate.ts
  • packages/3-extensions/sql-orm-client/src/query-plan-select.ts
  • packages/3-extensions/sql-orm-client/src/where-binding.ts
  • packages/3-extensions/sql-orm-client/test/grouped-collection.test.ts
  • packages/3-extensions/sql-orm-client/test/query-plan-aggregate.test.ts
  • packages/3-extensions/sql-orm-client/test/query-plan-select.test.ts
  • packages/3-extensions/sql-orm-client/test/variant-include.query-plan-fixtures.ts
  • packages/3-extensions/sql-orm-client/test/variant-include.query-plan-nested.test.ts
  • packages/3-extensions/sql-orm-client/test/variant-include.query-plan.test.ts
  • packages/3-extensions/sql-orm-client/test/where-binding.test.ts
  • packages/3-targets/6-adapters/postgres/src/core/sql-renderer.ts
  • packages/3-targets/6-adapters/postgres/test/adapter.test.ts
  • packages/3-targets/6-adapters/sqlite/src/core/adapter.ts
  • packages/3-targets/6-adapters/sqlite/test/adapter.test.ts
  • test/integration/test/sql-orm-client/include.test.ts

Comment thread packages/2-sql/4-lanes/relational-core/src/ast/json-value-projection.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@prisma-next/extension-author-tools

npm i https://pkg.pr.new/@prisma-next/extension-author-tools@1023

@prisma-next/mongo-runtime

npm i https://pkg.pr.new/@prisma-next/mongo-runtime@1023

@prisma-next/family-mongo

npm i https://pkg.pr.new/@prisma-next/family-mongo@1023

@prisma-next/sql-runtime

npm i https://pkg.pr.new/@prisma-next/sql-runtime@1023

@prisma-next/family-sql

npm i https://pkg.pr.new/@prisma-next/family-sql@1023

@prisma-next/extension-arktype-json

npm i https://pkg.pr.new/@prisma-next/extension-arktype-json@1023

@prisma-next/middleware-cache

npm i https://pkg.pr.new/@prisma-next/middleware-cache@1023

@prisma-next/mongo

npm i https://pkg.pr.new/@prisma-next/mongo@1023

@prisma-next/extension-paradedb

npm i https://pkg.pr.new/@prisma-next/extension-paradedb@1023

@prisma-next/extension-pgvector

npm i https://pkg.pr.new/@prisma-next/extension-pgvector@1023

@prisma-next/extension-postgis

npm i https://pkg.pr.new/@prisma-next/extension-postgis@1023

@prisma-next/postgres

npm i https://pkg.pr.new/@prisma-next/postgres@1023

@prisma-next/sql-orm-client

npm i https://pkg.pr.new/@prisma-next/sql-orm-client@1023

@prisma-next/sqlite

npm i https://pkg.pr.new/@prisma-next/sqlite@1023

@prisma-next/extension-supabase

npm i https://pkg.pr.new/@prisma-next/extension-supabase@1023

@prisma-next/target-mongo

npm i https://pkg.pr.new/@prisma-next/target-mongo@1023

@prisma-next/adapter-mongo

npm i https://pkg.pr.new/@prisma-next/adapter-mongo@1023

@prisma-next/driver-mongo

npm i https://pkg.pr.new/@prisma-next/driver-mongo@1023

@prisma-next/contract

npm i https://pkg.pr.new/@prisma-next/contract@1023

@prisma-next/utils

npm i https://pkg.pr.new/@prisma-next/utils@1023

@prisma-next/config

npm i https://pkg.pr.new/@prisma-next/config@1023

@prisma-next/errors

npm i https://pkg.pr.new/@prisma-next/errors@1023

@prisma-next/framework-components

npm i https://pkg.pr.new/@prisma-next/framework-components@1023

@prisma-next/operations

npm i https://pkg.pr.new/@prisma-next/operations@1023

@prisma-next/ts-render

npm i https://pkg.pr.new/@prisma-next/ts-render@1023

@prisma-next/contract-authoring

npm i https://pkg.pr.new/@prisma-next/contract-authoring@1023

@prisma-next/ids

npm i https://pkg.pr.new/@prisma-next/ids@1023

@prisma-next/psl-parser

npm i https://pkg.pr.new/@prisma-next/psl-parser@1023

@prisma-next/psl-printer

npm i https://pkg.pr.new/@prisma-next/psl-printer@1023

@prisma-next/cli

npm i https://pkg.pr.new/@prisma-next/cli@1023

@prisma-next/cli-telemetry

npm i https://pkg.pr.new/@prisma-next/cli-telemetry@1023

@prisma-next/config-loader

npm i https://pkg.pr.new/@prisma-next/config-loader@1023

@prisma-next/emitter

npm i https://pkg.pr.new/@prisma-next/emitter@1023

@prisma-next/language-server

npm i https://pkg.pr.new/@prisma-next/language-server@1023

@prisma-next/migration-tools

npm i https://pkg.pr.new/@prisma-next/migration-tools@1023

prisma-next

npm i https://pkg.pr.new/prisma-next@1023

@prisma-next/vite-plugin-contract-emit

npm i https://pkg.pr.new/@prisma-next/vite-plugin-contract-emit@1023

@prisma-next/mongo-codec

npm i https://pkg.pr.new/@prisma-next/mongo-codec@1023

@prisma-next/mongo-contract

npm i https://pkg.pr.new/@prisma-next/mongo-contract@1023

@prisma-next/mongo-value

npm i https://pkg.pr.new/@prisma-next/mongo-value@1023

@prisma-next/mongo-contract-psl

npm i https://pkg.pr.new/@prisma-next/mongo-contract-psl@1023

@prisma-next/mongo-contract-ts

npm i https://pkg.pr.new/@prisma-next/mongo-contract-ts@1023

@prisma-next/mongo-emitter

npm i https://pkg.pr.new/@prisma-next/mongo-emitter@1023

@prisma-next/mongo-schema-ir

npm i https://pkg.pr.new/@prisma-next/mongo-schema-ir@1023

@prisma-next/mongo-query-ast

npm i https://pkg.pr.new/@prisma-next/mongo-query-ast@1023

@prisma-next/mongo-orm

npm i https://pkg.pr.new/@prisma-next/mongo-orm@1023

@prisma-next/mongo-query-builder

npm i https://pkg.pr.new/@prisma-next/mongo-query-builder@1023

@prisma-next/mongo-lowering

npm i https://pkg.pr.new/@prisma-next/mongo-lowering@1023

@prisma-next/mongo-wire

npm i https://pkg.pr.new/@prisma-next/mongo-wire@1023

@prisma-next/sql-contract

npm i https://pkg.pr.new/@prisma-next/sql-contract@1023

@prisma-next/sql-errors

npm i https://pkg.pr.new/@prisma-next/sql-errors@1023

@prisma-next/sql-operations

npm i https://pkg.pr.new/@prisma-next/sql-operations@1023

@prisma-next/sql-schema-ir

npm i https://pkg.pr.new/@prisma-next/sql-schema-ir@1023

@prisma-next/sql-contract-psl

npm i https://pkg.pr.new/@prisma-next/sql-contract-psl@1023

@prisma-next/sql-contract-ts

npm i https://pkg.pr.new/@prisma-next/sql-contract-ts@1023

@prisma-next/sql-contract-emitter

npm i https://pkg.pr.new/@prisma-next/sql-contract-emitter@1023

@prisma-next/sql-lane-query-builder

npm i https://pkg.pr.new/@prisma-next/sql-lane-query-builder@1023

@prisma-next/sql-relational-core

npm i https://pkg.pr.new/@prisma-next/sql-relational-core@1023

@prisma-next/sql-builder

npm i https://pkg.pr.new/@prisma-next/sql-builder@1023

@prisma-next/target-postgres

npm i https://pkg.pr.new/@prisma-next/target-postgres@1023

@prisma-next/target-sqlite

npm i https://pkg.pr.new/@prisma-next/target-sqlite@1023

@prisma-next/adapter-postgres

npm i https://pkg.pr.new/@prisma-next/adapter-postgres@1023

@prisma-next/adapter-sqlite

npm i https://pkg.pr.new/@prisma-next/adapter-sqlite@1023

@prisma-next/driver-postgres

npm i https://pkg.pr.new/@prisma-next/driver-postgres@1023

@prisma-next/driver-sqlite

npm i https://pkg.pr.new/@prisma-next/driver-sqlite@1023

commit: 4557df2

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
postgres / no-emit 163.58 KB (+0.29% 🔺)
postgres / emit 145.72 KB (+0.3% 🔺)
mongo / no-emit 100.15 KB (0%)
mongo / emit 89.86 KB (0%)
cf-worker / no-emit 189.13 KB (+0.39% 🔺)
cf-worker / emit 169.29 KB (+0.41% 🔺)

Comment thread packages/2-sql/4-lanes/relational-core/src/ast/json-value-projection.ts Outdated
Comment thread packages/2-sql/4-lanes/relational-core/src/ast/types.ts
Comment thread packages/2-sql/4-lanes/relational-core/src/ast/types.ts Outdated
Comment thread packages/2-sql/4-lanes/relational-core/src/ast/types.ts Outdated
Comment thread packages/2-sql/4-lanes/relational-core/src/ast/types.ts Outdated
Comment thread packages/2-sql/4-lanes/relational-core/src/ast/types.ts Outdated
Comment thread packages/3-extensions/sql-orm-client/test/where-binding.test.ts Outdated
@aqrln aqrln changed the title TML-3062: add explicit JSON projection AST foundations feat(relational-core): add explicit JSON projection AST foundations (TML-3062) Jul 22, 2026
@aqrln aqrln changed the title feat(relational-core): add explicit JSON projection AST foundations (TML-3062) feat: add explicit JSON projection AST foundations (TML-3062) Jul 22, 2026
@tensordreams

Copy link
Copy Markdown
Contributor Author

Triage note — this compound review body was decomposed into A10a–A10d so each finding and the reproducible lint blocker can be handled independently. I’ll post separate outcomes for each sub-action; this parent item requires no code change.

@tensordreams

Copy link
Copy Markdown
Contributor Author

On it 👍 — this deep-freeze finding overlaps A01; I’m verifying and recording the shared codec-ref fix as the outcome for A10a.

@tensordreams

Copy link
Copy Markdown
Contributor Author

Done — A10a is satisfied by the shared codec-ref helper: nested typeParams are defensively cloned and deeply frozen on both construction paths. Focused immutability tests, relational-core typecheck, and lint pass. Commit: 268a09f.

@tensordreams

Copy link
Copy Markdown
Contributor Author

Won’t address A10b — the existing toMatchObject assertion intentionally verifies one cohesive AST node shape, so splitting each field into separate expect calls would make the test noisier without improving coverage. A09 removed the redundant manual narrowing around it while preserving this assertion.

@tensordreams

Copy link
Copy Markdown
Contributor Author

Out of scope for A10c — extracting a shared cross-adapter unreachable-kind helper would expand this feature PR into relational-core API and adapter ownership work. The existing local helpers are small and do not block the JSON projection change, so no shared utility is being introduced here.

@tensordreams

Copy link
Copy Markdown
Contributor Author

On it 👍 — I’m reproducing the post-rebase lint:throws delta, then I’ll replace each PR-introduced bare throw with structuredError for user-facing failures or InternalError/assertNever for invariants and run the affected checks.

@tensordreams

Copy link
Copy Markdown
Contributor Author

Done — 1b066d0 replaces exactly the five PR-introduced user-facing bare throws with structured errors and adds shape assertions for empty FunctionSource column aliases, empty CaseExpr branches, grouped HAVING function-call/cast/case rejection, SQLite WITH ORDINALITY, and SQLite returned-column aliases. Focused tests pass; relational-core and SQL ORM typechecks pass; affected package lints pass; SQLite production source typecheck passes before unrelated existing migration-test type errors; pnpm lint:throws is current=698, merge-base=698, delta=0.

@tensordreams
tensordreams force-pushed the tml-3062-sql-json-projection-ast-foundations branch from 19730c4 to 1b066d0 Compare July 22, 2026 13:04
@tensordreams

Copy link
Copy Markdown
Contributor Author

On it — I’ll inspect the full extension-substrate migration, record the concrete 0.16-to-0.17 extension-author upgrade actions, and validate them by execution in an isolated worktree. 👍

@tensordreams

tensordreams commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Done — added the adopt-sql-json-projection-ast-foundations entry under skills/extension-author/prisma-next-extension-upgrade/upgrades/0.16-to-0.17/, covering explicit JSON projection wrappers, function/cast/case visitor coverage, grouped function-source aliases, and codec-preserving projection forwarding. The prose-only migration reproduced the PR extension substrate in an isolated worktree; pnpm test --filter=./packages/3-extensions/*, pnpm check:upgrade-coverage --mode pr, and pnpm lint:skills pass. Committed as 82ab686b84c72670b17c7e0b6fad22c05e03fe27; the PR description now names the transition directory without changing its validation disclosure.

Pin the explicit projection algebra, behavior-preserving AST vocabulary, five-dispatch implementation sequence, validation gates, and persistent review contract for the first project slice.

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>
@tensordreams
tensordreams force-pushed the tml-3062-sql-json-projection-ast-foundations branch from 82ab686 to 4557df2 Compare July 22, 2026 14:19
@aqrln
aqrln enabled auto-merge July 22, 2026 14:58
@aqrln
aqrln added this pull request to the merge queue Jul 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 22, 2026
@aqrln
aqrln added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit 6afaca0 Jul 22, 2026
22 checks passed
@aqrln
aqrln deleted the tml-3062-sql-json-projection-ast-foundations branch July 22, 2026 15:26
tensordreams added a commit to prisma/prisma that referenced this pull request Jul 28, 2026
## Linked issue

Refs
[TML-3061](https://linear.app/prisma-company/issue/TML-3061/target-codec-descriptor-foundations)

Base: `main`. Predecessor
[#1023](prisma/prisma-next#1023) is merged, so
this PR has no stacked-base prerequisite.

## At a glance

```ts
nativeTypeFor(ref: CodecRef): string {
  return this.nativeType(this.validateParams(ref));
}

projectJson(expression: ProjectionExpr, ref: CodecRef): ProjectionExpr {
  const params = this.validateParams(ref);
  return ref.many === true
    ? this.jsonArrayProjection(expression, params)
    : this.jsonProjection(expression, params);
}
```

A PostgreSQL descriptor now accepts the generic `CodecRef` that 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 `PublicCodecTypes`
declaration-portability boundary plus extension-author migration
guidance.

## Reviewer notes

- The JSON projection hooks are public protocol capabilities, but
production PostgreSQL and SQLite renderers deliberately remain
pass-through. TML-3063 will activate descriptor dispatch and own the
observable lossless JSON hard cut.
- Codec JSON methods, emitted contracts, generated declarations,
fixtures, codec IDs, and current SQL/JSON representations are unchanged.
Drift in any of those surfaces was treated as a stop condition.
- `PublicCodecTypes` intentionally exposes only each codec's `input`,
`output`, and `traits` through composed contract declarations. This
keeps downstream semantic typing exact without making exported
declarations name concrete target descriptor implementation members.
- PostgreSQL extension authors must adopt the target protocol and add
the target package as a runtime dependency; direct adapter injection
also moves to target-typed `codecDescriptors`.
- Deterministic target, adapter, extension, declaration, workspace,
documentation, skill, manifest, dependency, cast, throw, upgrade,
fixture, and audit gates passed. The broad package, integration, and e2e
suites were also run, but Postgres/resource-related flakes remained
after varying and focused reruns, so their final broad confirmation is
CI-deferred and is not claimed green here.

## How it fits together

1.
[`PostgresCodecDescriptor`](packages/3-targets/3-targets/postgres/src/core/codec-descriptor.ts)
and
[`SqliteCodecDescriptor`](packages/3-targets/3-targets/sqlite/src/core/codec-descriptor.ts)
add stable structural discriminants and public template methods. Each
template method validates erased `CodecRef.typeParams` through the
descriptor's Standard Schema before calling a strongly typed target
hook.
2. `postgresCodec(...)`, `sqliteCodec(...)`,
`definePostgresCodecs(...)`, and `defineSqliteCodecs(...)` 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.
3. Target, adapter, and ordered extension contributions are collected
once per construction plane. The
[PostgreSQL](packages/3-targets/6-adapters/postgres/src/core/codec-lookup.ts)
and
[SQLite](packages/3-targets/6-adapters/sqlite/src/core/codec-lookup.ts)
builders structurally validate that set, reject malformed, wrong-target,
raw, or duplicate descriptors, and derive ordinary materialization plus
target lookup from the same immutable registry.
4. PostgreSQL parameter rendering now resolves trusted native type names
through `nativeTypeFor(ref)` on the validated descriptor. Runtime,
control, custom, enum, extension, and array cast spellings remain pinned
to their existing SQL.
5.
[`PublicCodecTypes`](packages/2-sql/2-authoring/contract-ts/src/contract-types.ts)
projects 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.
6. The [codec authoring guide](docs/reference/codec-authoring-guide.md)
and the upgrade entry under
[`skills/extension-author/prisma-next-extension-upgrade/upgrades/0.16-to-0.17/`](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

- **Extension authors can define and contribute target-owned PostgreSQL
and SQLite codecs through public APIs.** The protocols validate erased
refs before typed behavior, preserve concrete tuple/factory typing, and
use structural validation across separately loaded packages.
Implementation: [PostgreSQL descriptor
protocol](packages/3-targets/3-targets/postgres/src/core/codec-descriptor.ts),
[SQLite descriptor
protocol](packages/3-targets/3-targets/sqlite/src/core/codec-descriptor.ts).
Evidence: [PostgreSQL runtime
tests](packages/3-targets/3-targets/postgres/test/postgres-codec-descriptor.test.ts),
[SQLite runtime
tests](packages/3-targets/3-targets/sqlite/test/sqlite-codec-descriptor.test.ts).
- **PostgreSQL arrays have a target-owned default projection shape,
while SQLite rejects undefined stored scalar-array semantics.**
PostgreSQL's default lift binds the source once and preserves null
arrays, empty arrays, null elements, and ordinality; SQLite raises a
structured error for `CodecRef.many`. Implementation: [PostgreSQL
descriptor
protocol](packages/3-targets/3-targets/postgres/src/core/codec-descriptor.ts),
[SQLite descriptor
protocol](packages/3-targets/3-targets/sqlite/src/core/codec-descriptor.ts).
Evidence: [PostgreSQL descriptor
tests](packages/3-targets/3-targets/postgres/test/postgres-codec-descriptor.test.ts),
[SQLite descriptor
tests](packages/3-targets/3-targets/sqlite/test/sqlite-codec-descriptor.test.ts).
- **Runtime, control, and direct adapter paths now see one coherent
descriptor set and fail invalid composition early.** Bare adapters
remain built-ins-only; stack composition includes ordered target,
adapter, and extension contributions. Implementation: [PostgreSQL
registry
assembly](packages/3-targets/6-adapters/postgres/src/core/codec-lookup.ts),
[SQLite registry
assembly](packages/3-targets/6-adapters/sqlite/src/core/codec-lookup.ts).
Evidence: [PostgreSQL composition
tests](packages/3-targets/6-adapters/postgres/test/postgres-codec-registry-composition.test.ts),
[SQLite composition
tests](packages/3-targets/6-adapters/sqlite/test/sqlite-codec-registry-composition.test.ts).
- **First-party PostgreSQL extensions use one canonical target-typed
contribution set.** pgvector, PostGIS, and arktype-json expose the same
descriptor arrays through runtime and control metadata while retaining
current factories, application types, vector text, HEXEWKB, and
structured JSON representations. Implementation: [pgvector
codecs](packages/3-extensions/pgvector/src/core/codecs.ts), [PostGIS
codecs](packages/3-extensions/postgis/src/core/codecs.ts), [arktype-json
codec](packages/3-extensions/arktype-json/src/core/arktype-json-codec.ts).
Evidence: [pgvector adoption
tests](packages/3-extensions/pgvector/test/postgres-codec-descriptor-adoption.test.ts),
[PostGIS adoption
tests](packages/3-extensions/postgis/test/postgres-codec-descriptor-adoption.test.ts).
- **Consumer-exported contracts remain declaration-portable.** Extension
codec maps retain exact public input/output/trait semantics without
exposing target descriptor implementation structure. Implementation:
[`PublicCodecTypes`](packages/2-sql/2-authoring/contract-ts/src/contract-types.ts).
Evidence: [declaration
fixture](packages/3-extensions/pgvector/test/contract-declaration-portability.fixture.ts),
[declaration type
test](packages/3-extensions/pgvector/test/contract-declaration-portability.test-d.ts).
- **Current rendering remains unchanged while the new hooks stay
dormant.** PostgreSQL and SQLite still render codec, native, and
document projections as their wrapped expressions; composition tests
assert exact existing JSON SQL and zero descriptor projection calls.
Implementation: [PostgreSQL JSON
visitor](packages/3-targets/6-adapters/postgres/src/core/sql-renderer.ts),
[SQLite JSON
visitor](packages/3-targets/6-adapters/sqlite/src/core/adapter.ts).
Evidence: [PostgreSQL composition
tests](packages/3-targets/6-adapters/postgres/test/postgres-codec-registry-composition.test.ts),
[SQLite composition
tests](packages/3-targets/6-adapters/sqlite/test/sqlite-codec-registry-composition.test.ts).

## Compatibility / migration / risk

- This is a pre-1.0 public SPI change for PostgreSQL-bound extension
codecs. Extension descriptors must extend `PostgresCodecDescriptor` or
use `postgresCodec(...)`, define target behavior, contribute a
`definePostgresCodecs(...)` set through runtime and control paths, and
declare `@prisma-next/target-postgres` as a production dependency.
- PostgreSQL direct adapter options now accept target-typed
`codecDescriptors` in place of an independently assembled generic
`codecLookup`; SQLite gains the equivalent target-typed option.
- Invalid dynamic composition now fails during adapter construction. Raw
generic, wrong-target, structurally malformed, and duplicate descriptors
no longer survive until lookup or query lowering.
- `PublicCodecTypes` narrows incidental descriptor-derived members out
of exported contract types while preserving `input`, `output`, and
`traits`. Consumers depending on incidental implementation members
through contract types must move to the descriptor API.
- There is no data, emitted-contract, codec-ID, codec JSON, or fixture
migration in this PR. Production JSON projection remains pass-through
until TML-3063.

## Testing performed

Passed on the final branch state:

- Deterministic build, runtime test, typecheck, and lint gates for
PostgreSQL/SQLite targets, PostgreSQL/SQLite adapters, pgvector,
PostGIS, and arktype-json.
- Root `pnpm build` and `pnpm typecheck`.
- Runtime/type coverage for descriptor validation, target tuple
preservation, adapter composition, native-type/cast parity, dormant JSON
hooks, extension adoption, and `PublicCodecTypes` declaration
portability.
- Documentation, skill, and package-manifest validation; `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:packages`
- `pnpm test:integration`
- `pnpm test:e2e`

Postgres/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/`](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, required
`CodecRef.typeParams`, and behavior-preservation checks.

## Follow-ups

- TML-3063 will activate descriptor JSON projection dispatch, land the
lossless PostgreSQL/SQLite and extension representations, and remove
transitional generic metadata after production consumers have moved.

## Alternatives considered

- **Keep target behavior in generic `CodecMeta` or 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.
- **Validate descriptors with `instanceof`.** Rejected because
extensions may load a separate copy of a target package. Stable
structural discriminants and required methods preserve interoperability
across module identities.
- **Maintain separate ordinary and target registries.** Rejected because
the two views could disagree about membership, factories, or behavior.
Both views are now derived from one validated descriptor set.
- **Make identity JSON projection an implicit default.** Rejected
because omission would silently assert that the database representation
is already lossless. Every descriptor states the transitional behavior
explicitly.
- **Activate JSON projection hooks in this PR.** Rejected so
registry/authoring migration and representation changes remain
independently reviewable. TML-3063 owns the observable hard cut.

## Checklist

- [x] All commits are signed off (`git commit -s`) per the
[DCO](CONTRIBUTING.md#developer-certificate-of-origin-dco).
- [x] I read [CONTRIBUTING.md](CONTRIBUTING.md) and the change is scoped
to one logical concern.
- [x] Tests are updated for the public protocols, composition boundary,
extensions, declaration portability, and unchanged rendering behavior.
- [x] The PR title is in `TML-NNNN: <sentence-case title>` form and
names the concrete deliverable.
- [x] The **Skill update** section is filled in.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added PostgreSQL- and SQLite-specific codec descriptor authoring APIs,
including descriptor/codec registries and validation.
* Adapters now use provided target-specific codec descriptor sets to
keep runtime and control-plane behavior consistent.
* Improved native type handling and JSON projection behavior for
parameterized and scalar-array scenarios.
* **Bug Fixes**
* PostGIS geometry codecs now support optional SRID, with updated
typing, validation, and output rendering.
* **Documentation**
* Expanded codec authoring guide, target READMEs, and 0.16 → 0.17
upgrade instructions for adopting the new descriptor model.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants