Skip to content

Releases: iyulab/Schemorph

schemorph 0.3.0

Choose a tag to compare

@github-actions github-actions released this 13 Jul 15:10

Full Changelog: v0.2.0...v0.3.0

schemorph 0.2.0

Choose a tag to compare

@github-actions github-actions released this 12 Jul 14:38

Schemorph 0.2.0 — the agent-native release: everything an AI coding agent (or a script) needs to drive a schema change end-to-end, safely, without parsing human-oriented output.

Agent-native surface

  • Versioned machine-readable plan format (docs/plan-format.md) — changes[] with per-change action lists (1.0), a stable planHash fingerprint (1.1), and explanation on every change + sql where it is certain (1.2): redefines carry their exact idempotent script verbatim; declarative changes carry the slice of the update script attributed from DacFx's own per-object markers (conservative — unattributable is null, never a wrong attachment). Table rebuilds are called out with a cost note.
  • Gated applyapply --expect-plan <hash> (CLI) / expectedPlanHash (MCP): the plan computed in the same comparison session that would execute is checked against the reviewed fingerprint first; a mismatch aborts with plan_mismatch and nothing applied. Review-then-apply can no longer race a drifting database.
  • MCP server (schemorph mcp, stdio) — read-only tools (schemorph_diff, schemorph_inspect, schemorph_status) plus fingerprint-gated schemorph_apply; the connection string stays in the server environment, never in the conversation. Schema-as-context resources: schemorph://schema (live database as desired-state SQL), schemorph://schema/{kind}/{name}, schemorph://plan (current plan incl. planHash).
  • Agent-first CLI conventions — JSON by default on non-TTY stdout; a self-describing schema subcommand (verbs, flags, output formats, exit codes as a JSON manifest); unified help semantics (requested help → stdout + exit 0).
  • Agent Skill packagingskills/schemorph/SKILL.md: the safe change loop, machine-contract branching, migration immutability, MCP mode, brownfield adoption.
  • CI recipepost the plan as a PR comment: base-branch schema rebuilt in a service container, PR diffed against it, marker-based comment upsert, optional lint-code policy gate.

New verbs & safety

  • status — drift (the plan a diff would produce now), history-ledger summary, pending migrations; exit 2 when work is pending.
  • Safety-lint band SCHEMORPH1xx (docs/errors.md) — plan rules (NOT NULL addition without default / table-rebuild cost / destructive change included) and migration static checks on pending files (TRUNCATE, unfiltered UPDATE/DELETE, GRANT/REVOKE/DENY). AST-proven findings only; warnings never change the exit code.

Brownfield adoption

  • Existing databases and SSDT trees are consumed as-is: non-model files (SQLCMD deploy scripts, seed DML) are classified out with per-file warnings instead of poisoning the model; history-less programmable objects whose live definitions already match their files reconcile (recorded, nothing executed) instead of phantom-redefining.
  • GO inside strings/comments no longer splits batches (parser-based splitting, original text preserved).

Consistency & internals

  • Desired state is loaded and parsed once per operation, and everything — checksums, brownfield live-matching, lint, execution — judges that one snapshot: the checksum the ledger records always covers exactly the script that ran.
  • Unified error contract: desired-state load errors fail every verb the same way (invalid_desired_state on diff/status/apply alike).

Install

dotnet tool install -g Schemorph            # or update: dotnet tool update -g Schemorph

Self-contained binaries for win-x64 / linux-x64 / osx-arm64 are attached below.

Full Changelog: v0.1.0...v0.2.0

schemorph 0.1.0

Choose a tag to compare

@github-actions github-actions released this 12 Jul 08:57