Skip to content

feat: load canonical SQL migrations from spec/sql at runtime - #27

Closed
mwhitham wants to merge 1 commit into
mainfrom
cursor/sql-canonical-runtime-592a
Closed

mwhitham wants to merge 1 commit into
mainfrom
cursor/sql-canonical-runtime-592a

Conversation

@mwhitham

Copy link
Copy Markdown
Owner

Summary

Prerequisite R1 from the Rust adoption plan: the Node migration runner now executes the published plain SQL file in spec/sql/migrations/001-initial.sql instead of in-process TypeScript strings.

  • readCanonicalMigrationSqlFromDisk() strips the generated header and is used by createDatabase().
  • authoringMigrationSql() remains the TypeScript authoring source for pnpm generate:sql-contract.
  • spec/sql/README.md documents runtime vs authoring roles.
  • Drift check compares authoring output to on-disk files (no circular read).

Dependencies

Independent of PR #20 (plan). Complements CR3/CR5 contribution work.

Verification

pnpm check:public-data && pnpm typecheck && pnpm test && pnpm build
pnpm check:schema-drift

All passed on the agent VM.

Open in Web Open in Cursor 

Load spec/sql/migrations/001-initial.sql when creating databases. Keep
TypeScript modules as the authoring source for generate:sql-contract.
Update drift check to compare authoring output to on-disk SQL.

Co-authored-by: Michael Whitham <mwhitham@users.noreply.github.com>
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