Squawk-cli is a linter for PostgreSQL migrations and SQL, designed to identify potentially dangerous operations that could lead to database locks, downtime, or compatibility issues. It helps prevent unexpected downtime by enforcing best practices for schema changes. The current version is 2.47.0. It maintains a relatively active release cadence, with multiple minor versions often released within a few weeks to months.
pip install squawk-cliNo compatibility data collected yet for this library.
This quickstart demonstrates how to install `squawk-cli` and run it against a sample SQL migration file to detect potential issues. It creates a temporary SQL file, executes `squawk` on it, and then cleans up the file.
Configure your CI/CD pipeline to accept exit code 1 for warnings, or use squawk's configuration to exclude specific rules or files causing warnings if they are deemed acceptable. There is an open discussion for a flag to differentiate warnings and errors.
Ensure you are installing `squawk-cli` directly via `pip install squawk-cli` from the `squawk` project maintained by `sbdchd`. Reinstall if unsure.
Use strategies like `NOT VALID` with `VALIDATE CONSTRAINT` for new constraints, add nullable columns first, then backfill and make `NOT NULL`, and prefer `TEXT` fields over `VARCHAR` with length limits. For indexes, always use `CONCURRENTLY`. Squawk provides suggestions in its output.
Check the `squawk` changelog and update to the latest version to ensure support for newer PostgreSQL versions and syntax. Report parsing issues to the project maintainers if your valid SQL is not recognized.
If warnings are acceptable, modify your CI/CD configuration to allow exit code 1. Alternatively, configure Squawk (e.g., via `.squawk.toml` or `--exclude` flags) to ignore specific rules that generate warnings you deem acceptable.
Ensure your network can access `https://github.com/sbdchd/squawk/releases/download`. Verify the project's GitHub releases page for any reported issues or temporary outages. Try installing a specific older version if the latest is problematic (e.g., `pip install squawk-cli==X.Y.Z`).
Double-check your `.squawk.toml` configuration and command-line arguments. Ensure paths are correctly specified (glob matching is supported). Understand the precedence rules: `--exclude`, `--exclude-path`, and `--pg-version` flags override configuration file settings.
No dependency data recorded yet.