DEV.co
Open-Source Databases · sbdchd

squawk

Squawk is a linter for PostgreSQL migrations and SQL that prevents downtime-causing schema changes and enforces best practices. It runs as a CLI tool, integrates with GitHub Actions, VSCode, and pre-commit workflows, and provides detailed warnings with remediation suggestions.

Source: GitHub — github.com/sbdchd/squawk
1.1k
GitHub stars
66
Forks
PLpgSQL
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorysbdchd/squawk
Ownersbdchd
Primary languagePLpgSQL
LicenseApache-2.0 — OSI-approved
Stars1.1k
Forks66
Open issues44
Latest releasev2.59.0 (2026-06-27)
Last updated2026-07-07
Sourcehttps://github.com/sbdchd/squawk

What squawk is

Squawk parses SQL and migration files using a Rust-based parser, applies configurable linting rules (e.g., concurrent index creation, IDENTITY columns over SERIAL), and outputs results in multiple formats (TTY, JSON, GitLab). It supports Postgres version targeting and can assume transactions wrap migrations.

Quickstart

Get the squawk source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/sbdchd/squawk.gitcd squawk# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Preventing zero-downtime migration violations

Enforce rules like concurrent index creation, NOT VALID constraints, and avoiding ACCESS EXCLUSIVE locks in production migrations—preventing unexpected table locks and downtime.

Code review automation for database changes

Integrate into GitHub PR workflows via GitHub Action or upload-to-github subcommand to catch schema anti-patterns before merge, reducing post-deployment incidents.

Developer onboarding and SQL best practices

Use VSCode extension and web playground to teach teams Postgres schema design patterns (e.g., BIGINT over SERIAL, TEXT over VARCHAR) in real-time during development.

Implementation considerations

  • Install via npm, pip, or Docker; no database connection required—runs statically on SQL files.
  • Configure rule inclusion/exclusion globally (.squawk.toml) or per-file (squawk-ignore comments).
  • Integrate into CI/CD pipelines via GitHub Action, pre-commit hooks, or direct CLI invocation in build scripts.
  • Review rule documentation at squawkhq.com/docs/rules to understand which warnings apply to your migration workflow (some are warnings, not hard errors).
  • Consider --assume-in-transaction flag if your migration tool wraps all files in transactions, as some rules adapt behavior based on this context.

When to avoid it — and what to weigh

  • Non-PostgreSQL databases — Squawk is PostgreSQL-specific; it will not help with MySQL, SQLite, or other SQL dialects.
  • Real-time query performance analysis — Squawk lints schema structure and migration patterns, not query execution plans or runtime performance tuning. Use EXPLAIN ANALYZE or query profilers separately.
  • Programmatic rule customization — Squawk rules are fixed; there is no public API to define custom linting logic. Configuration is limited to including/excluding predefined rules.
  • Proprietary or closed-source requirement — Squawk is Apache 2.0 licensed open-source; if your compliance mandates all software to remain proprietary, this is not suitable.

License & commercial use

Apache License 2.0 (Apache-2.0) permits commercial use, modification, and distribution provided original license and copyright notice are included.

Apache 2.0 is a permissive OSI-approved license that allows commercial use without royalty or proprietary requirement, provided you include the Apache 2.0 license text in distributions. No vendor lock-in or commercial support agreement required.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Squawk is a static analysis tool on text files; it does not connect to live databases or execute SQL. Primary considerations: (1) GitHub token secrets if using upload-to-github integration—manage via Actions secrets, (2) input validation of SQL syntax—malformed SQL may cause parsing errors (not exploitable, but behavior should be tested), (3) no authentication/authorization enforced in the tool itself; relies on file system and CI/CD access controls.

Alternatives to consider

sqlfluff

Multi-dialect SQL linter with broader language support (Postgres, MySQL, T-SQL, etc.) and customizable rules via Python plugins; heavier than Squawk but more flexible.

pganalyze schema advisor / Stripe pg-schema-diff

Postgres-specific schema comparison tools; pg-schema-diff focuses on detecting safe vs. unsafe migrations at the diff level rather than linting raw SQL.

strong_migrations (Rails) / django-pg-zero-downtime-migrations

Framework-specific migration linters (Ruby/Django); tighter integration with ORM migration tools but limited to those ecosystems.

Software development agency

Build on squawk with DEV.co software developers

Integrate Squawk into your PostgreSQL workflow today. Start with the CLI or web playground—no database connection required.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

squawk FAQ

Does Squawk require a Postgres database to run?
No. Squawk is a static linter that parses SQL syntax without connecting to any database. It can run offline and in any CI/CD environment.
Can I disable specific rules per migration file?
Yes. Use SQL comments: `-- squawk-ignore rule-name` for a single statement, `-- squawk-ignore-file rule-name` for the entire file, or omit rule names to ignore all rules in that file.
Does Squawk work with non-Postgres SQL?
No. Squawk is designed for PostgreSQL migrations and SQL syntax. Rules are Postgres-specific and will not apply to MySQL, SQLite, or other dialects.
How do I integrate Squawk into my GitHub CI/CD?
Use the official GitHub Action (sbdchd/squawk-action) or run squawk CLI in your workflow and pipe results to upload-to-github subcommand for PR comments.

Work with a software development agency

Need help beyond evaluating squawk? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.

Ready to prevent migration disasters?

Integrate Squawk into your PostgreSQL workflow today. Start with the CLI or web playground—no database connection required.