DeltaScope is an offline-first TiDB schema change audit tool that analyzes DDL statements before they reach your TiDB cluster. It catches destructive ALTER TABLE operations, missing defaults, incompatible type changes, and dozens of other risky patterns in CI pipelines, developer workflows, and AI agent sessions.
Pass one or more DDL statements to DeltaScope with --dialect tidb. It parses the SQL using TiDB-compatible syntax, evaluates every applicable rule, and returns a verdict with blockers, warnings, and notices. No database connection is needed for offline audit.
$ deltascope audit --dialect tidb --sql "ALTER TABLE users DROP COLUMN email;"
Verdict: reject
Statements: 1
Blockers: 1
Warnings: 0
Notices: 0
Statement 1: ALTER TABLE
- [blocker] ddl.alter.drop.column: dropping column "email" is a destructive change
Connect to a live TiDB instance to enrich findings with table statistics:
deltascope audit \
--dialect tidb \
--sql "alter table users add column email varchar(255)" \
--host 127.0.0.1 --port 4000 --user root --ask-password --schema app \
--metadata-connect-timeout 5s
# GitHub Actions example
- name: Audit TiDB schema changes
run: |
deltascope audit \
--dialect tidb \
--file ./migrations/tidb_schema_change.sql \
--format github-actions \
--fail-on blocker
DeltaScope also supports --format sarif for GitHub Code Scanning and --format gitlab-codequality for GitLab CI.
Use the same audit engine from the CLI, in CI, via HTTP service, or through the MCP server for AI agents. Every path uses the same rules and the same policy configuration.
--dialect tidb to enable TiDB-compatible parsing. The same rules and integration paths work for MySQL and TiDB.--config.