Skip to content

feat: standalone inspect and migrate - #10

Merged
moshloop merged 7 commits into
mainfrom
feat/standalone-inspect-migrate-dmbctdx4xeds
Oct 23, 2026
Merged

moshloop merged 7 commits into
mainfrom
feat/standalone-inspect-migrate-dmbctdx4xeds

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, plus read-only script analysis
  • Adds reviewed PostgreSQL/SQLite schema artifacts with exact saved SQL, bounded locking, destructive acknowledgements, drift detection, rollback, and postconditions
  • Resolves HCL primary-key names, SQL literals, and effective collations before building SQL Server artifacts
  • Preserves SQL Server v1 artifact hashes and locking

Notes

  • Builds on the trigger and planner changes in sqlglot-go PR feat(tsql): parse triggers into trees #9
  • Reviewed PostgreSQL script/security bundles and OIPA deployment integration remain tracked backlog work
  • Validation: all 10 tracked Gavel fixture gates pass. The general Gavel test adapter reports missing Ginkgo metadata; the command fixture runs successfully.

@moshloop
moshloop added this pull request to stack #11 October 22, 2026 12:40
@moshloop
moshloop force-pushed the feat/standalone-inspect-migrate-dmbctdx4xeds branch from 3264e44 to 1d74c75 Compare October 22, 2026 12:41
Base automatically changed from feat/tsql-parse-triggers to main October 22, 2026 12:55
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
Expose the connectionless PlanApplier from the standalone SQL Server runtime so commons-db can retain its original DefaultPlan API. Planning remains available without a database; execution retains the existing explicit no-connection error.

Validated with a Ginkgo regression covering both methods, make build, and native lint with zero issues.
Normalize native separators and keep drive letters in the file URI path rather than the authority. Windows migration and CLI tests failed because file://C:%5C... was parsed as a host with an invalid port.

Add platform-independent drive URI regression coverage and verify that native filenames with spaces and URL punctuation create the exact intended SQLite file. Database and CLI tests, make build, and native lint pass.
@moshloop
moshloop force-pushed the feat/standalone-inspect-migrate-dmbctdx4xeds branch from 1d74c75 to b71d8ea Compare October 22, 2026 12:55
Claude-Session-Id: 01a15eea-9e79-7161-890a-03eac0c66cf1
moshloop added a commit that referenced this pull request Oct 22, 2026
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.
moshloop added a commit that referenced this pull request Oct 22, 2026
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.
Claude-Session-Id: 01a15eea-9e79-7161-890a-03eac0c66cf1
Claude-Session-Id: 01a15eea-9e79-7161-890a-03eac0c66cf1
moshloop added a commit to flanksource/commons-db that referenced this pull request Oct 23, 2026
Replace commons-db SQL inspection, capabilities, custom Atlas SQL Server runtime, target parsing, catalog readers, and migration engines with typed sqlglot-go shims. Preserve existing public options and types, caller-owned handles, PostgreSQL bundle behavior, and catalog cache metadata. Move implementation-owned tests with the engine and retain consumer compatibility coverage.

Pin sqlglot-go v1.0.4-0.20261022121445-328654b54c0a, the published commit from flanksource/sqlglot-go#10, so the new packages resolve without a local replacement. Merge the sqlglot dependency PR first.

Validation: all 10 tracked database Gavel fixture gates pass, including SQLite API/cache compatibility, existing PostgreSQL bundle/view-dependency migrations, and the standalone native engine suite. Unrelated Git, query, and connection changes are excluded from this commit.

Gavel-Issue-Id: e5e4b378-75e4-4291-9c72-585d138a7cef
@moshloop
moshloop marked this pull request as ready for review October 23, 2026 03:56
@moshloop
moshloop merged commit 78ed96e into main Oct 23, 2026
12 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

moshloop added a commit to flanksource/commons-db that referenced this pull request Oct 23, 2026
Replace commons-db SQL inspection, capabilities, custom Atlas SQL Server runtime, target parsing, catalog readers, and migration engines with typed sqlglot-go shims. Preserve existing public options and types, caller-owned handles, PostgreSQL bundle behavior, and catalog cache metadata. Move implementation-owned tests with the engine and retain consumer compatibility coverage.

Pin sqlglot-go v1.0.4-0.20261022121445-328654b54c0a, the published commit from flanksource/sqlglot-go#10, so the new packages resolve without a local replacement. Merge the sqlglot dependency PR first.

Validation: all 10 tracked database Gavel fixture gates pass, including SQLite API/cache compatibility, existing PostgreSQL bundle/view-dependency migrations, and the standalone native engine suite. Unrelated Git, query, and connection changes are excluded from this commit.

Gavel-Issue-Id: e5e4b378-75e4-4291-9c72-585d138a7cef
moshloop added a commit to flanksource/commons-db that referenced this pull request Oct 23, 2026
Replace commons-db SQL inspection, capabilities, custom Atlas SQL Server runtime, target parsing, catalog readers, and migration engines with typed sqlglot-go shims. Preserve existing public options and types, caller-owned handles, PostgreSQL bundle behavior, and catalog cache metadata. Move implementation-owned tests with the engine and retain consumer compatibility coverage.

Pin sqlglot-go v1.0.4-0.20261022121445-328654b54c0a, the published commit from flanksource/sqlglot-go#10, so the new packages resolve without a local replacement. Merge the sqlglot dependency PR first.

Validation: all 10 tracked database Gavel fixture gates pass, including SQLite API/cache compatibility, existing PostgreSQL bundle/view-dependency migrations, and the standalone native engine suite. Unrelated Git, query, and connection changes are excluded from this commit.

Gavel-Issue-Id: e5e4b378-75e4-4291-9c72-585d138a7cef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant