Repository navigation
TML-2503: the complete, faithful Supabase contract — introspected from a reference instance - #960
Conversation
|
Warning Review limit reached
Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (55)
📝 WalkthroughWalkthroughThis change adds PostgreSQL ChangesPostgreSQL contract fidelity
Supabase contract generation
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Generator
participant SupabaseFixture
participant Postgres
participant ContractEmitter
Generator->>SupabaseFixture: restore reference roles and schema
Generator->>Postgres: introspect auth and storage
Postgres-->>Generator: tables, indexes, types, and RLS metadata
Generator->>ContractEmitter: emit normalized PSL and contract artifacts
ContractEmitter-->>Generator: contract.prisma, contract.json, and contract.d.ts
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 📦
|
4827891 to
7d37273
Compare
dfd282d to
9407d12
Compare
7d37273 to
55257eb
Compare
9407d12 to
06a2b13
Compare
55257eb to
94870cc
Compare
ed8da49 to
506d8d5
Compare
92cd08d to
5a2a6ce
Compare
506d8d5 to
bcf34ca
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts (1)
29-36: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winUse a direct contract type in this type-level test.
Derive
AppContractstructurally or from shared emitted types instead of invokingdefineContract; runtime builders can widen types and allow type assertions to pass for the wrong reason.Based on learnings,
*.test-d.tsfiles should avoid runtime builders such asdefineContractduring type-level evaluation.🤖 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/supabase/test/service-role-refresh-tokens.test-d.ts` around lines 29 - 36, Replace the runtime defineContract call used to create appContract with a direct structural AppContract type or the appropriate shared emitted contract type. Keep the existing SupabaseDb<AppContract> assertion intact, and ensure the type-level test no longer depends on defineContract’s inferred or widened runtime-builder types.Source: Learnings
🤖 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/3-extensions/supabase/README.md`:
- Line 7: Revise the README description near the Supabase extension pack
overview to replace the “complete, faithful contract of everything Supabase
owns” claim with a complete object inventory for the pinned fixture. Explicitly
acknowledge the documented omissions of columns, defaults, and indexes while
preserving the statements about auth/storage tables, enum types, platform roles,
external ownership, migration behavior, and verification.
- Line 9: Update the project-reference links in the Supabase package README,
including the link near the role-binding runtime description and the
additionally flagged section, to point to stable package documentation,
CONTRACT-FIDELITY.md, or the relevant ADR instead of delivery-plan or
deferred-project files. Preserve the surrounding integration description.
In `@packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md`:
- Line 34: Replace the transient projects/supabase-integration/deferred.md
reference in CONTRACT-FIDELITY.md with a stable package or architecture
documentation link, or summarize the scope decision directly in this paragraph.
Preserve the existing list of intentionally undeclared schemas and its ownership
rationale.
---
Nitpick comments:
In `@packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts`:
- Around line 29-36: Replace the runtime defineContract call used to create
appContract with a direct structural AppContract type or the appropriate shared
emitted contract type. Keep the existing SupabaseDb<AppContract> assertion
intact, and ensure the type-level test no longer depends on defineContract’s
inferred or widened runtime-builder types.
🪄 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: 641ef16d-eb7a-4d6f-84ec-cdcab2ea728a
⛔ Files ignored due to path filters (5)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlprojects/extension-supabase/plan.mdis excluded by!projects/**projects/psl-ambient-declarations/spec.mdis excluded by!projects/**projects/supabase-integration/decisions.mdis excluded by!projects/**projects/supabase-integration/deferred.mdis excluded by!projects/**
📒 Files selected for processing (48)
packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.tspackages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.tspackages/2-sql/2-authoring/contract-psl/src/interpreter.tspackages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.tspackages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.tspackages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.tspackages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.tspackages/2-sql/9-family/src/core/foreign-key-index-backing.tspackages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.tspackages/2-sql/9-family/src/core/psl-contract-infer/printer-config.tspackages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.tspackages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.tspackages/3-extensions/supabase/README.mdpackages/3-extensions/supabase/package.jsonpackages/3-extensions/supabase/scripts/generate-contract.tspackages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.mdpackages/3-extensions/supabase/src/contract/contract.d.tspackages/3-extensions/supabase/src/contract/contract.jsonpackages/3-extensions/supabase/src/contract/contract.prismapackages/3-extensions/supabase/src/contract/roles.tspackages/3-extensions/supabase/test/brownfield-infer.integration.test.tspackages/3-extensions/supabase/test/contract-completeness.test.tspackages/3-extensions/supabase/test/contract-handles.test.tspackages/3-extensions/supabase/test/fixtures/supabase-reference/restore.tspackages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sqlpackages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sqlpackages/3-extensions/supabase/test/reference-fixture-verify.integration.test.tspackages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.tspackages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.tspackages/3-extensions/supabase/test/supabase-bootstrap.tspackages/3-extensions/supabase/tsconfig.jsonpackages/3-targets/3-targets/postgres/src/core/codec-ids.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/psl-infer/infer-psl-contract.tspackages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.tspackages/3-targets/3-targets/postgres/src/exports/codecs.tspackages/3-targets/3-targets/postgres/test/codecs-class.test.tspackages/3-targets/3-targets/postgres/test/codecs.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.tspackages/3-targets/6-adapters/postgres/src/core/control-adapter.tspackages/3-targets/6-adapters/postgres/src/core/descriptor-meta.tspackages/3-targets/6-adapters/postgres/test/control-adapter.test.tspackages/3-targets/6-adapters/postgres/test/descriptor-meta.test.tsskills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
There was a problem hiding this comment.
Why do we have this script? I thought the idea was to use prisma-next contract infer for this?
There was a problem hiding this comment.
It does use the contract infer engine — the script calls the same inferPostgresPslContract. What it cannot use is the CLI command, because the PSL writer only emits a single flat namespace bucket today (TML-2958 stopgap — infer-psl-contract.ts:335; it throws on a same-named table across two schemas). The Supabase contract needs three namespaces: auth, storage, and namespace unbound for the roles. So the script calls the inferrer per-schema and assembles the multi-namespace document itself. When TML-2958 teaches the writer multi-namespace output, this script collapses into prisma-next contract infer and is deleted. It is orchestration around the same engine, not a second inference path.
4dc3d7b to
4a4e134
Compare
4a4e134 to
cf3f134
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md (1)
34-34: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winReplace the transient
projects/documentation link.This still links durable docs to
projects/supabase-integration/deferred.md. A previous review already flagged this exact reference, and retrieved learnings say durable package docs must not reference transientprojects/artifacts (specs/plans/milestones). Link a stable package/architecture doc instead, or inline the scope-decision summary.🤖 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/supabase/src/contract/CONTRACT-FIDELITY.md` at line 34, Replace the transient projects/supabase-integration/deferred.md link in CONTRACT-FIDELITY.md with a stable package or architecture documentation link, or inline the relevant scope-decision summary. Preserve the existing explanation that the listed schemas are intentionally undeclared.Source: Learnings
🧹 Nitpick comments (1)
packages/3-extensions/supabase/scripts/generate-contract.ts (1)
19-19: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
patheinstead ofnode:path.This script reads/writes fixture and generated-contract files from disk (
restoreSupabaseReference,writeFileSyncat Line 634, the bin path at Line 637). Based on learnings, preferpatheovernode:pathfor such tooling/fixture-touching files in this repo.♻️ Proposed fix
-import { dirname, join } from 'node:path'; +import { dirname, join } from 'pathe';Also applies to: 47-47, 633-633, 637-637
🤖 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/supabase/scripts/generate-contract.ts` at line 19, Replace the node:path dependency with pathe throughout generate-contract.ts, updating dirname, join, and any related path usage in restoreSupabaseReference, writeFileSync, and the bin path handling while preserving existing behavior.Source: Learnings
🤖 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/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md`:
- Line 22: Correct the “Column defaults” count in CONTRACT-FIDELITY.md from 8 to
7 so it matches the seven entries listed and the DEFAULT_OMISSIONS definition in
generate-contract.ts. Leave the listed columns and surrounding explanation
unchanged.
In `@packages/3-extensions/supabase/src/contract/contract.d.ts`:
- Around line 4950-4982: Update deriveBackRelationFieldName in
name-transforms.ts to avoid appending a plural suffix when the model name is
already plural, while preserving pluralization for singular names. Regenerate
the Supabase contract so back-relation fields use corrected names such as
mfaAmrClaims, identities, and sessions instead of double-pluralized variants.
---
Duplicate comments:
In `@packages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.md`:
- Line 34: Replace the transient projects/supabase-integration/deferred.md link
in CONTRACT-FIDELITY.md with a stable package or architecture documentation
link, or inline the relevant scope-decision summary. Preserve the existing
explanation that the listed schemas are intentionally undeclared.
---
Nitpick comments:
In `@packages/3-extensions/supabase/scripts/generate-contract.ts`:
- Line 19: Replace the node:path dependency with pathe throughout
generate-contract.ts, updating dirname, join, and any related path usage in
restoreSupabaseReference, writeFileSync, and the bin path handling while
preserving existing behavior.
🪄 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: aaf6348b-34dd-4683-9f4d-f3c9fe045a7a
⛔ Files ignored due to path filters (5)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlprojects/extension-supabase/plan.mdis excluded by!projects/**projects/psl-ambient-declarations/spec.mdis excluded by!projects/**projects/supabase-integration/decisions.mdis excluded by!projects/**projects/supabase-integration/deferred.mdis excluded by!projects/**
📒 Files selected for processing (48)
packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.tspackages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.tspackages/2-sql/2-authoring/contract-psl/src/interpreter.tspackages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.tspackages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.tspackages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.tspackages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.tspackages/2-sql/9-family/src/core/foreign-key-index-backing.tspackages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.tspackages/2-sql/9-family/src/core/psl-contract-infer/printer-config.tspackages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.tspackages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.tspackages/3-extensions/supabase/README.mdpackages/3-extensions/supabase/package.jsonpackages/3-extensions/supabase/scripts/generate-contract.tspackages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.mdpackages/3-extensions/supabase/src/contract/contract.d.tspackages/3-extensions/supabase/src/contract/contract.jsonpackages/3-extensions/supabase/src/contract/contract.prismapackages/3-extensions/supabase/src/contract/roles.tspackages/3-extensions/supabase/test/brownfield-infer.integration.test.tspackages/3-extensions/supabase/test/contract-completeness.test.tspackages/3-extensions/supabase/test/contract-handles.test.tspackages/3-extensions/supabase/test/fixtures/supabase-reference/restore.tspackages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sqlpackages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sqlpackages/3-extensions/supabase/test/reference-fixture-verify.integration.test.tspackages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.tspackages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.tspackages/3-extensions/supabase/test/supabase-bootstrap.tspackages/3-extensions/supabase/tsconfig.jsonpackages/3-targets/3-targets/postgres/src/core/codec-ids.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/psl-infer/infer-psl-contract.tspackages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.tspackages/3-targets/3-targets/postgres/src/exports/codecs.tspackages/3-targets/3-targets/postgres/test/codecs-class.test.tspackages/3-targets/3-targets/postgres/test/codecs.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.tspackages/3-targets/6-adapters/postgres/src/core/control-adapter.tspackages/3-targets/6-adapters/postgres/src/core/descriptor-meta.tspackages/3-targets/6-adapters/postgres/test/control-adapter.test.tspackages/3-targets/6-adapters/postgres/test/descriptor-meta.test.tsskills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
🚧 Files skipped from review as they are similar to previous changes (42)
- packages/3-targets/3-targets/postgres/src/exports/codecs.ts
- packages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.ts
- packages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.ts
- packages/3-extensions/supabase/tsconfig.json
- packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.ts
- packages/3-extensions/supabase/src/contract/roles.ts
- packages/3-targets/3-targets/postgres/src/core/codec-ids.ts
- packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
- packages/3-extensions/supabase/package.json
- packages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.ts
- packages/2-sql/9-family/src/core/psl-contract-infer/printer-config.ts
- packages/2-sql/9-family/src/core/foreign-key-index-backing.ts
- packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts
- packages/3-extensions/supabase/test/fixtures/supabase-reference/restore.ts
- packages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.ts
- packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.ts
- packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
- packages/3-targets/3-targets/postgres/src/core/codec-type-map.ts
- packages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sql
- packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
- packages/3-extensions/supabase/test/supabase-bootstrap.ts
- packages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.ts
- packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts
- packages/3-extensions/supabase/README.md
- packages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.ts
- packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
- packages/3-extensions/supabase/test/contract-handles.test.ts
- packages/3-targets/3-targets/postgres/test/codecs.test.ts
- packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
- packages/3-extensions/supabase/test/contract-completeness.test.ts
- packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
- packages/3-targets/3-targets/postgres/src/core/codecs.ts
- packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
- packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
- packages/3-targets/6-adapters/postgres/src/core/descriptor-meta.ts
- packages/3-extensions/supabase/test/reference-fixture-verify.integration.test.ts
- packages/3-targets/6-adapters/postgres/test/control-adapter.test.ts
- packages/3-targets/3-targets/postgres/test/codecs-class.test.ts
- skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
- packages/3-extensions/supabase/src/contract/contract.json
- packages/3-extensions/supabase/src/contract/contract.prisma
- packages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sql
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.md (1)
34-36: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMove emitter-lowering mechanics out of the ADR.
“Emit materializes…” and “lowered at emit” describe implementation mechanics. Keep the ADR focused on the architectural decision and invariants, and move lowering details to the relevant subsystem documentation.
As per retrieved guidance, ADRs should document design decisions and constraints rather than implementation algorithms.
🤖 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/architecture` docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.md around lines 34 - 36, Revise the “The corrected model” section to state only the architectural entities and invariants, removing emitter-specific wording such as “Emit materializes,” “lowered at emit,” and references to contract.json representation. Move those lowering mechanics to the relevant emitter or subsystem documentation, while retaining the distinction between foreign-key constraints, discrete indexes, and authoring-only configuration.Source: Learnings
🤖 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/architecture` docs/adrs/ADR 161 - Explicit foreign key constraint and
index configuration.md:
- Around line 9-23: Update the JSON examples in the ADR to use the canonical
contract shape under storage.tables, with foreignKeys entries containing columns
and references; ensure both indexed and non-indexed examples are valid contract
JSON. If retaining the simplified top-level source/target notation, explicitly
label it as conceptual rather than canonical.
- Line 7: Revise the ADR statements around the foreign-key and index contract to
distinguish an omitted indexes entry from verified physical absence in the
database. Preserve the rule that each is an independent contract entity, and
explicitly state that under control: 'external', undeclared live indexes are
tolerated rather than treated as missing.
---
Nitpick comments:
In `@docs/architecture` docs/adrs/ADR 161 - Explicit foreign key constraint and
index configuration.md:
- Around line 34-36: Revise the “The corrected model” section to state only the
architectural entities and invariants, removing emitter-specific wording such as
“Emit materializes,” “lowered at emit,” and references to contract.json
representation. Move those lowering mechanics to the relevant emitter or
subsystem documentation, while retaining the distinction between foreign-key
constraints, discrete indexes, and authoring-only configuration.
🪄 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: a1241cfa-f624-427a-875d-b0139a1b05ae
📒 Files selected for processing (2)
docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.mddocs/architecture docs/subsystems/1. Data Contract.md
20e4cfc to
cd87beb
Compare
|
Post-approval changes (CodeRabbit round + merge-readiness), for reviewer awareness:
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/3-extensions/supabase/scripts/generate-contract.ts (2)
17-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPrefer
patheovernode:pathin this script.This is a tooling script (not a test file), where the repo convention is
pathefor path operations. Based on learnings, "prefer importing and using 'pathe' over the built-in 'node:path' module for path operations across the codebase (including CLI commands and tooling files)."♻️ Proposed fix
-import { dirname, join } from 'node:path'; +import { dirname, join } from 'pathe';🤖 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/supabase/scripts/generate-contract.ts` around lines 17 - 20, Replace the node:path import used by the generate-contract script with the repository’s pathe path utilities, preserving the existing dirname and join behavior wherever those symbols are used.Source: Learnings
166-201: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the repeated namespace-reconstruction boilerplate.
applyIndexOmissions,applyDoublePluralizationFix,applyDefaultOmissions,applyRlsEnablement,renameModels, andrewriteFieldTypeNamesall end with the identicalmakePslNamespace({ kind: 'namespace', name: namespace.name, entries: makePslNamespaceEntries(models, namespace.compositeTypes, namespacePslExtensionBlocks(namespace)), span: namespace.span })block. A smallwithModels(namespace, models)helper would remove this duplication across six call sites.♻️ Proposed helper
+function withModels(namespace: PslNamespace, models: readonly PslModel[]): PslNamespace { + return makePslNamespace({ + kind: 'namespace', + name: namespace.name, + entries: makePslNamespaceEntries( + models, + namespace.compositeTypes, + namespacePslExtensionBlocks(namespace), + ), + span: namespace.span, + }); +}Then each of the six functions above collapses its trailing block to
return withModels(namespace, models);.Also applies to: 239-265, 336-366, 382-403, 462-499, 502-528
🤖 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/supabase/scripts/generate-contract.ts` around lines 166 - 201, Extract the repeated namespace reconstruction into a shared withModels(namespace, models) helper that preserves the existing kind, name, composite types, extension blocks, and span. Replace the identical makePslNamespace boilerplate at the ends of applyIndexOmissions, applyDoublePluralizationFix, applyDefaultOmissions, applyRlsEnablement, renameModels, and rewriteFieldTypeNames with calls to this helper, leaving each function’s transformation and unchanged-namespace behavior intact.
🤖 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-extensions/supabase/scripts/generate-contract.ts`:
- Around line 17-20: Replace the node:path import used by the generate-contract
script with the repository’s pathe path utilities, preserving the existing
dirname and join behavior wherever those symbols are used.
- Around line 166-201: Extract the repeated namespace reconstruction into a
shared withModels(namespace, models) helper that preserves the existing kind,
name, composite types, extension blocks, and span. Replace the identical
makePslNamespace boilerplate at the ends of applyIndexOmissions,
applyDoublePluralizationFix, applyDefaultOmissions, applyRlsEnablement,
renameModels, and rewriteFieldTypeNames with calls to this helper, leaving each
function’s transformation and unchanged-namespace behavior intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: eba6acc9-fff2-4356-9abf-0678319bf0b8
⛔ Files ignored due to path filters (5)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlprojects/extension-supabase/plan.mdis excluded by!projects/**projects/psl-ambient-declarations/spec.mdis excluded by!projects/**projects/supabase-integration/decisions.mdis excluded by!projects/**projects/supabase-integration/deferred.mdis excluded by!projects/**
📒 Files selected for processing (53)
docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.mddocs/architecture docs/subsystems/1. Data Contract.mdexamples/supabase/vitest.config.tspackages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.tspackages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.tspackages/2-sql/2-authoring/contract-psl/src/interpreter.tspackages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.tspackages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.tspackages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.tspackages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.tspackages/2-sql/9-family/src/core/foreign-key-index-backing.tspackages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.tspackages/2-sql/9-family/src/core/psl-contract-infer/printer-config.tspackages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.tspackages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.tspackages/3-extensions/supabase/README.mdpackages/3-extensions/supabase/package.jsonpackages/3-extensions/supabase/scripts/generate-contract.tspackages/3-extensions/supabase/src/contract/CONTRACT-FIDELITY.mdpackages/3-extensions/supabase/src/contract/contract.d.tspackages/3-extensions/supabase/src/contract/contract.jsonpackages/3-extensions/supabase/src/contract/contract.prismapackages/3-extensions/supabase/src/contract/roles.tspackages/3-extensions/supabase/test/brownfield-infer.integration.test.tspackages/3-extensions/supabase/test/contract-completeness.test.tspackages/3-extensions/supabase/test/contract-handles.test.tspackages/3-extensions/supabase/test/fixtures/supabase-reference/restore.tspackages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sqlpackages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sqlpackages/3-extensions/supabase/test/reference-fixture-verify.integration.test.tspackages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.tspackages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.tspackages/3-extensions/supabase/test/supabase-bootstrap.tspackages/3-extensions/supabase/tsconfig.jsonpackages/3-targets/3-targets/postgres/src/core/codec-ids.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/psl-infer/infer-psl-contract.tspackages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.tspackages/3-targets/3-targets/postgres/src/exports/codecs.tspackages/3-targets/3-targets/postgres/test/codecs-class.test.tspackages/3-targets/3-targets/postgres/test/codecs.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.tspackages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.tspackages/3-targets/6-adapters/postgres/src/core/control-adapter.tspackages/3-targets/6-adapters/postgres/src/core/descriptor-meta.tspackages/3-targets/6-adapters/postgres/test/control-adapter.test.tspackages/3-targets/6-adapters/postgres/test/descriptor-meta.test.tsskills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.mdtest/integration/vitest.config.tstest/integration/vitest.journeys.config.ts
🚧 Files skipped from review as they are similar to previous changes (47)
- packages/3-targets/3-targets/postgres/test/psl-infer/postgres-type-map.test.ts
- packages/3-targets/3-targets/postgres/src/exports/codecs.ts
- packages/3-extensions/supabase/test/service-role-refresh-tokens.test-d.ts
- packages/3-extensions/supabase/tsconfig.json
- packages/3-targets/3-targets/postgres/src/core/codec-ids.ts
- packages/2-sql/9-family/src/core/psl-contract-infer/printer-config.ts
- packages/3-targets/3-targets/postgres/test/psl-infer/infer-psl-contract-described-contracts.test.ts
- packages/2-sql/2-authoring/contract-psl/src/psl-column-resolution.ts
- packages/3-targets/3-targets/postgres/test/codecs-class.test.ts
- packages/3-targets/3-targets/postgres/src/core/psl-infer/postgres-type-map.ts
- packages/3-targets/3-targets/postgres/test/codecs.test.ts
- packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.naming-and-constraints.test.ts
- packages/2-sql/1-core/schema-ir/src/ir/sql-index-ir.ts
- packages/3-extensions/supabase/test/fixtures/supabase-reference/restore.ts
- skills/extension-author/prisma-next-extension-upgrade/upgrades/0.14-to-0.15/instructions.md
- packages/2-sql/1-core/schema-ir/src/ir/sql-column-ir.ts
- packages/3-targets/3-targets/postgres/test/psl-infer/print-psl/print-psl.relations.test.ts
- packages/3-targets/6-adapters/postgres/src/core/descriptor-meta.ts
- packages/2-sql/2-authoring/contract-psl/test/interpreter.types.test.ts
- packages/3-targets/6-adapters/postgres/test/descriptor-meta.test.ts
- packages/2-sql/2-authoring/contract-psl/src/psl-relation-resolution.ts
- packages/3-extensions/supabase/test/fixtures/supabase-reference/roles.sql
- packages/3-extensions/supabase/src/contract/roles.ts
- packages/3-extensions/supabase/README.md
- packages/2-sql/2-authoring/contract-psl/src/interpreter.ts
- packages/2-sql/9-family/src/core/foreign-key-index-backing.ts
- packages/3-targets/3-targets/postgres/src/core/psl-infer/infer-psl-contract.ts
- packages/3-extensions/supabase/package.json
- packages/3-extensions/supabase/test/reference-fixture-verify.integration.test.ts
- packages/3-extensions/supabase/test/service-role-refresh-tokens.integration.test.ts
- packages/2-sql/9-family/src/core/psl-contract-infer/relation-inference.ts
- packages/2-sql/9-family/src/core/migrations/contract-to-schema-ir.ts
- packages/3-targets/6-adapters/postgres/test/control-adapter.test.ts
- packages/3-targets/6-adapters/postgres/src/core/control-adapter.ts
- packages/3-targets/3-targets/postgres/src/core/codec-type-map.ts
- packages/3-extensions/supabase/test/supabase-bootstrap.ts
- packages/2-sql/2-authoring/contract-psl/test/interpreter.relations.test.ts
- packages/3-extensions/supabase/test/contract-handles.test.ts
- packages/3-extensions/supabase/test/contract-completeness.test.ts
- docs/architecture docs/adrs/ADR 161 - Explicit foreign key constraint and index configuration.md
- packages/2-sql/9-family/test/psl-contract-infer/relation-inference.test.ts
- packages/3-targets/3-targets/postgres/src/core/codecs.ts
- docs/architecture docs/subsystems/1. Data Contract.md
- packages/3-extensions/supabase/src/contract/contract.d.ts
- packages/3-extensions/supabase/src/contract/contract.prisma
- packages/3-extensions/supabase/test/fixtures/supabase-reference/schema.sql
- packages/3-extensions/supabase/src/contract/contract.json
Round-tripping the first large externally-owned schema (Supabase) through db verify exposed gaps this fixes: - PSL @relation gains an optional boolean index argument lowering onto the foreign key IR flag that already existed; contract infer emits index: false for FKs introspected without a live backing index. Both sides share one predicate (foreign-key-index-backing.ts) so verify and inference cannot disagree about what backs an FK. - The postgres target gains pg/inet@1 — a transparent string carrier modeled on pg/uuid@1; inet columns are authorable as String @db.Inet and contract infer maps them instead of printing Unsupported("inet"). - contractToSchemaIR keeps an array column nativeType as the bare element type with many: true instead of baking in "[]", so list columns compare equal against live introspection. - Postgres introspection excludes expression-keyed indexes and no longer collides a unique and non-unique index over identical columns; infer carries a non-default index access method as @@index(type:). - The contract canonicalizer preserves value: false in resolved defaults instead of stripping it as an empty value. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
… contract The pack contract now describes everything Supabase owns — all 23 auth and 10 storage tables of the reference version, 10 native enum types, and the three roles — generated, not hand-authored: pnpm contract:generate restores the checked-in reference fixture (pg_dump of every schema from supabase/postgres:17.6.1.106, version pins recorded) into fresh PGlite, introspects auth and storage, assembles named PSL namespace blocks plus the top-level role blocks from SUPABASE_ROLES, and emits. Reruns are byte-identical. The five legacy model names (AuthUser, AuthIdentity, AuthSession, StorageBucket, StorageObject) are preserved; everything the pipeline deliberately does not declare (2 nullable array columns, 8 defaults, 2 hash indexes) is recorded in CONTRACT-FIDELITY.md and omission is verify-safe under external. bootstrapSupabaseShim now restores the reference fixture instead of a hand-authored 5-table subset (RESET ALL afterwards — the pg_dump preamble sets row_security=off, which must not leak into the caller session). Tests: round-trip verify against the restored fixture (clean, with realtime/vault present as tolerated extras; dropping a declared table fails naming it), contract completeness, brownfield contract infer (user tables in public survive, FK resolves to supabase:auth.AuthUser, no owned or undeclared-schema element leaks), and the service_role .supabase surface reading auth.refresh_tokens through sql and orm. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…ries Slice F marked done with the as-built pipeline; the undeclared-schemas scope decision lands in deferred.md; extension-author upgrade entries cover the pack contract expansion, the @relation index argument and pg/inet codec, the false-default canonicalization change, and the array/introspection round-trip fixes. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The environment-block design from the Slice C review, written down so it is findable when the second ambient entity kind arrives: grammar sketch, pack-contributed contents, the two storage-shape options, the managed-CREATE EXTENSION growth path, migration from the shipped top-level role blocks, and the open keyword/refs questions. Linked from offcut OC4. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
Adapts the generator, completeness test, and fidelity notes to the
merged Slice C shape: roles.ts is the SupabaseRole enumType handle, and
the generator emits the three roles inside an explicit
`namespace unbound { role … }` block (required by the merged placement
check) sourced from SupabaseRole.values, replacing the earlier
top-level role blocks. Regenerates the contract artifacts: the role
entities serialize under the __unbound__ slot (postgres-unbound-schema)
with their entity namespaceId unchanged.
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
FK1: foreign keys and indexes as discrete contract entities — supersedes ADR 161 (which deliberately put the constraint/index booleans on the FK). Argued on facts-not-instructions plus the new point that Slice F's introspection/verify reconciliation broke ADR 161's self-contained claim; framed narrowly, not as "the contract is unambiguous". FK2: the auth/storage contract split for opt-in composition. Both are their own slices; recorded so they are not lost. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…entities
The per-FK constraint/index booleans are emission directives, not facts.
The index boolean cannot name the index it asserts exists (it can only
mean "the deterministically-named index"), and ADR 161's own §5
("if no covering index") contradicts its §1 self-containment claim. Lead
ADR 161 with the corrected decision — a foreign key and its backing index
are discrete contract entities, each stating a fact — using the concrete
index-name example, and keep the original boolean design below as the
superseded record. Illustrate the same point on the Data Contract
"facts, not instructions" principle.
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
…DR 161 - CONTRACT-FIDELITY.md: correct the column-defaults count (8 → 7, matching DEFAULT_OMISSIONS), and replace the transient projects/ link with the scope rationale inline. - ADR 161: label the discrete-entity JSON example as conceptual notation for the proposed model, not a literal of the current contract. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The framework inferrer pluralizes back-relation field names unconditionally, so Supabase's already-plural table names (sessions, identities, …) came out double-pluralized in the generated contract (sessionses, identitieses, …) — public relation names a consumer would type. Correct the 20 affected names in the pack's generator via a declarative field-name table, mirroring the existing DEFAULT_OMISSIONS/MODEL_RENAMES corrections, and regenerate. The general inflection fix in the inferrer is tracked as a separate follow-up. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
…M abort
The PGlite (WASM) suites intermittently abort on the slower CI runners even
with --no-memory-protection-keys ("Connection terminated unexpectedly"). The
Supabase example is the acute case — restoring the full 33-table reference
fixture is the heaviest single WASM op — but the integration suites hit it too.
Mirror the CI-gated retry the e2e framework config already uses (retry twice on
CI, never locally so real flakes stay visible).
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
The upgrade-coverage gate requires any PR touching examples/ to record intent in the in-flight instructions.md. This PR's examples/ diff is the supabase walking-skeleton test plus a CI-only vitest retry config, over the additive complete-contract regeneration — no user upgrade action. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The PGlite (WASM) suites re-run the crashed test via each suite's `retry` config, but the retry alone did not clear CI: when the dev server aborts, the pg client emits an asynchronous 'error' event, and with no listener Node surfaces it as an *unhandled* error that fails the whole run even though the test already passed on retry. Attach an 'error' listener (queries still reject on their own, so nothing real is masked) and swallow a cleanup-time end() rejection on the already-dropped connection. Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
880717d to
cc4b5af
Compare
… promoted doc Four files referenced projects/supabase-integration/ or projects/ extension-supabase/: the package and example READMEs (links to decisions.md / the umbrella README -> the promoted "Supabase Integration" design-history doc), native-postgres-enums (plan link -> merged PR #960), and psl-ambient-declarations (OC1/OC4/deferred links -> the promoted doc). The README touches trip the upgrade-coverage gate, so this also opens the 0.15-to-0.16 transition dirs in both upgrade skills with changes: [] and an incidental scope note. Part of the Supabase integration close-out (TML-2503). Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
The
@prisma-next/extension-supabasecontract is now the complete, faithful description of everything Supabase owns in the database — all 23authand 10storagetables of the reference platform version, 10 native enum types, and the three roles — generated by introspection, not hand-authored:Reruns are byte-identical; the round-trip is pinned in CI. Builds on Slice C (#957, merged) — the roles this contract carries. Decision C8/C16 background in
projects/supabase-integration/decisions.md.Why a checked-in complete dump
A user's Supabase database contains far more than the pack declares (
realtime,vault,pgsodium,extensions,graphql*, …). Both halves of that split now have teeth:auth/storage):db verifyagainst the restored fixture is clean, and dropping one declared table makes it fail naming that table (reference-fixture-verify.integration.test.ts).public, runscontract inferwith the pack in the stack, and asserts the output contains only the user's models (with the FK intoauth.usersrewritten tosupabase:auth.AuthUser) and no element of any owned or undeclared schema.The fixture header records the version pins and every PGlite-restore trim.
bootstrapSupabaseShimnow restores this fixture instead of a hand-authored 5-table subset, so every composed-verify test runs against the real shape.Fidelity has an explicit, auditable boundary
Everything the pipeline cannot faithfully express is omitted, never approximated — under
external, verify fails on declared-but-missing and tolerates undeclared extras, so under-declaring is safe and wrong-declaring is not. The full inventory (2 nullabletext[]columns — PSL has no nullable-list syntax; 8 defaults; 2USING hashindexes; 8 partial uniques) lives insrc/contract/CONTRACT-FIDELITY.mdwith machine-readable omission configs in the generation script.Framework fixes the real schema smoked out
First time a large externally-owned schema round-tripped through
db verify; it found real bugs, each fixed with unit tests:pg/inet@1codec (transparent string carrier likepg/uuid@1), soauth.sessions.ipandauth.mfa_challenges.ip_addressare declared instead of omitted, andcontract infermaps introspectedinetcolumns toString @db.Inetinstead ofUnsupported("inet").@relationgains an optionalindexargument lowering onto the FK IR's existingindexflag, andcontract inferemitsindex: falsefor FKs introspected without a live backing index — 16 real Supabase FK columns have none, and the derived index expectation previously made any such inferred contract fail verify against its own source database. Verify and inference now share one backing predicate (foreign-key-index-backing.ts) so they cannot disagree.contractToSchemaIRkept"text[]"innativeTypeinstead of bare element type +many: true, so every list column verifiednot-equal.lower(email)) no longer collapse into colliding column lists; a legitimate unique + non-unique pair over identical columns no longer collides in the differ; a non-default index access method carries through as@@index(..., type: …).value: falsein resolved defaults (previously stripped as an "empty" value, so@default(false)never survived emit).SET row_security = offis neutralized withRESET ALLafter fixture restore — it leaked into the shared test session and broke non-owner queries on RLS-enabled tables.Surface
db.asServiceRole().supabase.{sql,orm}now exposes the full owned set — integration + type tests readauth.refresh_tokensthrough both. The five legacy model handles (AuthUser,AuthIdentity,AuthSession,StorageBucket,StorageObject) keep their names (examples and cross-space FKs depend on them); other models take the standard infer naming. Extension-author upgrade entries cover the contract expansion and each framework change.Alternatives considered
realtime/vault/… too — platform-internal machinery with no user-facing data surface; recorded inprojects/supabase-integration/deferred.md.🤖 Generated with Claude Code
Summary by CodeRabbit
inetsupport, mapping toString@db.Inet``.index?: booleanon relation fields so foreign keys can opt out of emitting a backing index viaindex: false(including inference when no matching backing index exists).many) handling and ensured relation outputs includeindex: falsewhen applicable.indexoptions are now rejected for backrelation list fields with clearer diagnostics.