Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

db schema-verify - #14

Closed
wmadden wants to merge 33 commits into
mainfrom
schema-verify
Closed

wmadden wants to merge 33 commits into
mainfrom
schema-verify

Conversation

@wmadden

@wmadden wmadden commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@wmadden wmadden closed this Nov 17, 2025
wmadden added a commit that referenced this pull request Mar 30, 2026
Mongo has no DDL — schema evolution is entirely data migration.
The invariant model from the migration workstream is a natural
fit. Add a future user promise (schema evolution via data
invariants) and design question #14 linking the two workstreams.
wmadden added a commit that referenced this pull request Mar 30, 2026
Mongo has no DDL — schema evolution is entirely data migration.
The invariant model from the migration workstream is a natural
fit. Add a future user promise (schema evolution via data
invariants) and design question #14 linking the two workstreams.
wmadden added a commit that referenced this pull request Mar 31, 2026
Mongo has no DDL — schema evolution is entirely data migration.
The invariant model from the migration workstream is a natural
fit. Add a future user promise (schema evolution via data
invariants) and design question #14 linking the two workstreams.
jkomyno pushed a commit that referenced this pull request Apr 1, 2026
Mongo has no DDL — schema evolution is entirely data migration.
The invariant model from the migration workstream is a natural
fit. Add a future user promise (schema evolution via data
invariants) and design question #14 linking the two workstreams.
jkomyno added a commit that referenced this pull request May 8, 2026
* #7 — SQLite AFTER-trigger mitigation: decision recorded as defer.
  JSDoc on buildRowIdentityCriterion + Query Lanes.md paragraph remain
  the documented mitigation; no runtime guard added until the SQLite
  adapter actually exercises id-less + AFTER-trigger contracts.

* #8 — Asymmetric `returning` gate: comment at executeUpdateCount
  records the explicit design choice. Surface-level updateCount/
  deleteCount require the capability; FK-rewrite cleanup
  (disconnect/setNull) does not, since no row data is read.

* #9 — Trim WHAT-restating sentence from buildRowIdentityCriterion
  comment block. Remaining lines explain the genuinely non-obvious
  WHY: RETURNING-by-construction invariant + duplicate-tuple caveat
  + SQLite AFTER-trigger caveat.

* #10 — Add typed `withoutPrimaryKey<TTable>(contract, table)` helper
  to test/helpers.ts mirroring `withCapabilities`. Migrate four call
  sites (createIdlessTagsCollection, createIdlessUsersCollection, two
  unit tests in mutation-executor.test.ts) from inline
  `as unknown as TestContract` casts to the helper. Cast lives in one
  place now.

* #11 — Drop redundant `updateCount returns zero` integration test
  on id-less Tags. The zero-match path is already covered by unit
  tests on PK contracts and does not exercise id-less specifics.

* #12 — Extract `getPrimaryKeyColumns(contract, tableName): readonly
  string[]` helper in collection-contract.ts. Replaces three
  duplicated raw-storage accesses (resolvePrimaryKeyColumn,
  pickCountReturningColumn, buildRowIdentityCriterion, the new P1
  guard).

* #13 — Plan doc references the post-rename name throughout.

* #14 — Trim `resolvePrimaryKeyColumn` error to one sentence; the
  API guidance prose duplicated content already in Query Lanes.md.

All 8 P3 todos marked complete. pnpm test:packages 110/110 green;
pnpm lint:deps 0 violations. sql-orm-client suite is 501 (one fewer
than before due to dropped redundant test).
wmadden added a commit that referenced this pull request May 12, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.
wmadden added a commit that referenced this pull request May 13, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.
wmadden added a commit that referenced this pull request May 13, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 13, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 13, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.

Signed-off-by: Will Madden <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant