Skip to content

feat(database): add inspect and migrate - #12

Open
moshloop wants to merge 5 commits into
mainfrom
chore/oipa-sync-20261022
Open

moshloop wants to merge 5 commits into
mainfrom
chore/oipa-sync-20261022

Conversation

@moshloop

Copy link
Copy Markdown
Member

What

  • Moves live inspection, capabilities, Atlas SQL Server integration, and bundle migration engines from commons-db into sqlglot-go/database; commons-db keeps typed compatibility shims.
  • Adds a schema inspect and migrate plan/apply CLI.
  • Adds reviewed PostgreSQL and SQLite schema artifacts with exact saved SQL, bounded locking, destructive-change acknowledgements, drift detection, rollback, and postconditions.
  • Resolves HCL primary-key names, SQL literals, and effective collations before building SQL Server artifacts.
  • Keeps a connectionless Atlas plan applier that refuses to execute without a database connection.
  • Normalizes SQLite file URIs on Windows (native separators, drive letters, filenames with spaces and URL punctuation).

Why

  • Standalone ownership of inspection and migrations, with commons-db kept compatible.
  • SQL Server v1 artifact hashes and locking are preserved.

Notes

  • Depends on the trigger and planner changes in sqlglot-go PR feat(tsql): parse triggers into trees #9.
  • Validation: all 10 tracked Gavel fixture gates pass, including standalone tests, build, native lint, SQLite example, PostgreSQL reviewed execution, commons-db compatibility, and remote SQL Server runtime and bundle execution.
  • The general Gavel test adapter reports missing Ginkgo metadata; the command fixture runs successfully.
  • Reviewed PostgreSQL script/security bundles and OIPA deployment integration are tracked backlog work and not in this PR.

Claude-Session-Id: 01a15eea-9e79-7161-890a-03eac0c66cf1
Move live inspection, capabilities, Atlas SQL Server integration, and bundle migration engines from commons-db into sqlglot-go/database. Keep commons-db as typed compatibility shims and preserve SQL Server v1 artifact hashes and locking.

Add one schema inspect and migrate plan/apply CLI, read-only script analysis, and reviewed PostgreSQL/SQLite schema artifacts with exact saved SQL, bounded locking, destructive acknowledgements, drift detection, rollback, and postconditions. Resolve HCL primary-key names, SQL literals, and effective collations before building SQL Server artifacts.

Validation: all 10 tracked Gavel fixture gates pass, including standalone tests, build, native lint, SQLite example, PostgreSQL reviewed execution, commons-db compatibility, and remote SQL Server runtime and bundle execution. The general Gavel test adapter separately reports missing Ginkgo metadata; the command fixture runs successfully.

Reviewed PostgreSQL script/security bundles and OIPA deployment integration remain tracked backlog work. This builds on the trigger and planner changes in sqlglot-go PR #9.

Gavel-Issue-Id: e5e4b378-75e4-4291-9c72-585d138a7cef
Mirror the verified DefaultPlan compatibility export from sqlglot-go PR #10 into the original checkout. Ginkgo verifies planning and refusal to execute without a database connection.
Retain the verified PR #10 fix in the original checkout: convert native separators and keep drive letters in URI paths. Ginkgo covers drive URI encoding and exact filenames with spaces and URL punctuation.
…w order

Row order from unordered queries was flagged as nondeterminism, causing false failures and undercounted coverage. Repeat checks now compare rows as multisets, and same-rows-different-order results count toward the comparable floor. Adds regression tests for the execution oracle, runs them in CI, and moves the nil check ahead of the field access in the Redshift UNPIVOT test.
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.

1 participant