Static safety linter for PostgreSQL DDL migrations. pgsafe parses SQL and flags schema
changes likely to lock or break production — no database connection, no network.
📖 Full documentation, the rules reference, and an in-browser playground: pgsafe.fixedwidth.tech
Install from crates.io with a Rust toolchain:
cargo install pgsafeOr download a prebuilt binary from the latest release
(static Linux and macOS), or build from source with cargo build --release (binary at
target/release/pgsafe).
pgsafe migration.sql # lint a file (exit 1 on a finding)
pgsafe --format json migration.sql # machine-readable
pgsafe --list-rules # every rule this build checksRun it in CI with the GitHub Action:
- uses: fixed-width/pgsafe@v0.8.6
with:
files: "db/migrate/*.sql"See pgsafe.fixedwidth.tech/docs for configuration, output formats, and the full rules reference.
Apache-2.0. See LICENSE.