Stop breaking schema changes before they leave your machine. Generate a pre-commit hook that diffs your old and new schema files on every commit โ locally, privately, and for free.
For the plain git hook, save it to .git/hooks/pre-commit and make it executable: chmod +x .git/hooks/pre-commit. For the pre-commit framework, add the YAML to .pre-commit-config.yaml.
The hook runs automatically when you commit any file. It diffs your configured schema paths and prints a summary to your terminal.
With "Fail on breaking" enabled, the commit is rejected if SchemaLens detects dropped tables, columns, or other risky changes.
Dropped tables, dropped columns, type changes, and removed constraints block the commit.
Added tables, columns, and indexes pass through with a clear report.
Every diff gets a 0โ100 risk score so reviewers know what to prioritize.
Schema files are sent to SchemaLens for diffing; no database connection required.