Skip to content

feat(migrate): add offline v1 planner - #41

Merged
moshloop merged 1 commit into
mainfrom
feat/offline-v1-migration-planner
Nov 26, 2026
Merged

moshloop merged 1 commit into
mainfrom
feat/offline-v1-migration-planner

Conversation

@moshloop

Copy link
Copy Markdown
Member

What

  • Add a pure offline planner for SQL Server migrations that does not require a registered database dialect.
  • Add engine.PlanRequest.Using to supply the dialect directly; Plan rejects a Using dialect whose Name differs from Dialect.
  • Add the v1 Plan, BuildArtifact, and ValidateArtifact API.
  • Add rspress docs config and tsconfig.json for the documentation site.

Why

  • Migrations can be planned without a registered database dialect.

Notes

  • Artifacts are hashed over their snapshots and plan, so edited SQL is refused.
  • BuildArtifact rejects snapshots outside the declared schema scope.

Add a pure offline planner so SQL Server migrations can be planned without a registered database dialect. engine.PlanRequest gains a Using field that supplies the dialect directly, and Plan rejects a Using dialect whose Name differs from Dialect.

Adds the v1 Plan, BuildArtifact and ValidateArtifact API. Artifacts are hashed over their snapshots and plan, so edited SQL is refused. BuildArtifact rejects snapshots outside the declared schema scope.

Also adds rspress docs config and tsconfig.json for the documentation site.

Claude-Session-Id: aac3359c-0751-4548-86ed-cf84a8c20d9a
@moshloop
moshloop enabled auto-merge (rebase) November 26, 2026 04:37
@moshloop
moshloop merged commit b2e7baf into main Nov 26, 2026
9 of 10 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.6.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration
postgres 32 0 0 4.1s

Totals: 32 passed · 0 failed · 0 skipped · 4.1s

View full results

@github-actions

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration
integration 34 0 0 1m54s

Totals: 34 passed · 0 failed · 0 skipped · 1m54s

View full results

@github-actions

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration
sqlglot 186 1 0 2.0s
access 35 0 0 7ms
atlasdriver 11 0 0 7ms
capabilities 36 0 0 6ms
changeset 5 0 0 374.925µs
compare 19 0 0 1.6s
connections 10 0 0 15ms
csvdata 5 0 0 984.406µs
database 3 0 0 565ms
dialect 16 0 0 9ms
engine 135 0 0 36ms
github.com/flanksource/sqlglot-go/database/atlas/internal/specutil 5 0 0 -
github.com/flanksource/sqlglot-go/database/atlas/internal/sqlx 61 0 0 -
github.com/flanksource/sqlglot-go/database/inspect 3 0 0 -
github.com/flanksource/sqlglot-go/database/migrate 20 0 0 -
github.com/flanksource/sqlglot-go/harness 14 0 1 6.5s
github.com/flanksource/sqlglot-go/sqlglot 3025 0 0 950ms
harness 7 0 0 420.109µs
history 15 0 0 60ms
inspect 1 0 0 112.217µs
migrate 119 0 7 1.3s
postgres 21 0 0 26ms
proxy 3 0 0 12ms
scripts 92 0 0 49ms
snapshot 19 0 0 6ms
sqlite 61 0 0 1.5s
sqlserver 518 0 0 320ms
target 33 0 0 14ms
tds 60 0 0 231ms
workflow 84 0 0 207ms

Totals: 4622 passed · 1 failed · 8 skipped · 15.5s

Failing tests

sqlglot — migration filesystem confinement > plans --label sources that each start with the same schema block

Expected
    <string>: {
      "artifact": {
        "version": 2,
... (145 more lines truncated)

View full results

@github-actions

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration
lint: golangci-lint 1 0 0 2m32s

Totals: 1 passed · 0 failed · 0 skipped · 2m32s

View full results

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