Skip to content

fix: qualify real PostgreSQL generation and validation - #57

Merged
smiggleworth merged 1 commit into
developfrom
release/050-postgres-tooling
Oct 9, 2026
Merged

smiggleworth merged 1 commit into
developfrom
release/050-postgres-tooling

Conversation

@smiggleworth

@smiggleworth smiggleworth commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The shipped PostgreSQL generation/validation workflow stops at a reset stub, returns identity rows instead of schema snapshots, and generates no result columns. This change completes the scratch workflow and verifies it against real and normally installed PostgreSQL adapters.

Scratch reset first proves actual database separation with database-local advisory locks while the target is pinned in a read-only transaction. The scratch adapter owns a serialized physical session and a workflow lock through reset, replay, rollback-only desired-DDL normalization, diff and query description. Native catalog comparison preserves physical facts; application properties/codecs stay in source identity, and only explicitly declared constraint/index names participate in name equality. Unsupported schema shapes fail with corrective errors. Reset's destructive scope and the direct/session-pool requirement are documented.

Query metadata uses protocol Parse/Describe/Sync and never Bind/Execute. Multi-command input is rejected before any command runs. Result nullability is conservative; generated types match standard pg parsers or remain unknown. Repeated named parameters produce one generated property while retaining positional bindings, and duplicate output column names require aliases. Native tests also exposed and fixed quoted enum identifiers, composite primary keys, related-table creation order and unique-column rename/no-op behavior.

Validation:

  • Node 24.21.0 full gate against isolated PostgreSQL 18.6: 100 tests pass (70 ordinary, 12 existing runtime integration, 18 real tooling cases). The final native suite fails 17 scenarios against previous merged source 3f59575; unreachable-target refusal is one passing characterization, not a new bug fix.
  • Focused refinement RED cases cover quoted enums, incremental related tables, unique-column rename, four previously ignored schema attributes, duplicate result names, and repeated parameter declarations rejected by TypeScript.
  • Native assertions cover preserved target data through URL aliases, unreachable target, reset rollback, scratch lock handoff, concurrent descriptions with pool size one, no inserted rows/advanced sequences during description, deterministic catalogs, complete generate/validate/no-op, stale/drift/replay failures and artifact preservation/recovery.
  • Normal minimum-peer installed PostgreSQL generate/validate/no-op and generated artifact compilation under strict TypeScript 6 and 7 pass. Packed checks retain exactly 78 names, 54 removed imports, 16 private paths, root/SQLite optional-peer isolation and SQLite recovery.
  • Formatting, lint/types, implementation coverage, build, unchanged benchmark gate, publint, packing and full npm audit pass. Measured implementation coverage is 1474/1692 lines (87.11%) and 881/1179 branches (74.72%); uncovered branches remain visible. The runtime CheckedOutClient body is byte-identical after its private-module move.
  • Hosted CI now provisions a separate disposable scratch database and runs both source and installed workflows on PostgreSQL 16/17/18. Exact head 69a9fb5 passes all PostgreSQL source/installed lanes, Linux/macOS/Windows package gates, the required package aggregate and CodeQL (CI 37998776550; CodeQL 37998772655).

Closes #55. Refs #53 and #54; those remain open for the coordinated 0.5.0 candidate and generated website qualification. No version bump, tag, GitHub release or npm publication is included. The maintainer's full review and approval of the final coordinated candidate remain required before official publication.

@smiggleworth
smiggleworth merged commit af7c838 into develop Oct 9, 2026
10 checks passed
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.

bug: PostgreSQL generation and validation use incomplete shadow tooling

1 participant