# DBLab vs Squawk: lint migration SQL, then run it on a clone

> Squawk lints PostgreSQL migration files for statements that take risky locks. DBLab executes the migration on a full-size clone and fails it if a lock is held too long.

Checked on 2026-11-18. Page: https://postgres.ai/compare/dblab-vs-squawk. All comparisons: https://postgres.ai/compare.

## Short answer

Squawk is an open-source linter, formatter and language server for PostgreSQL migrations. It parses SQL files and warns about statements such as CREATE INDEX without CONCURRENTLY, a column type change or a missing lock_timeout. DBLab does not lint. It gives you a full-size thin clone, where DB Migration Checker runs the migration and fails it if it holds a dangerous lock too long. The two fit together: Squawk flags risky SQL in the pull request, DBLab shows what the change does on real data. Squawk's own docs say a migration that passes its lint is not automatically safe to run.

## What DBLab adds to Squawk

1. **Runs the migration on full-size data.**
   - DBLab: DB Migration Checker applies pending migrations to a full-size clone in CI and collects statistics from the run. ([DB Migration Checker](https://postgres.ai/docs/database-lab/db-migration-checker))
   - Squawk: Squawk parses the SQL text of migration files and reports rule violations. Its guide says a migration that passes Squawk's lint is not automatically safe to run. [1][7]
2. **Measures the locks a migration holds.**
   - DBLab: The checker fails a migration that holds a dangerous lock longer than a limit, 10 seconds by default. ([DB Migration Checker](https://postgres.ai/docs/database-lab/db-migration-checker))
   - Squawk: Squawk's rule docs name the lock a statement takes, such as the ACCESS EXCLUSIVE lock for a column type change, and a rule requires a lock_timeout. The lock is predicted from the SQL; the sources do not describe measuring how long it is held. [5][6][2]
3. **Run it again from the same state.**
   - DBLab: On a clone, reset returns the data to the snapshot, so a migration can be run again. ([How to reset a DBLab clone](https://postgres.ai/docs/dblab-howtos/cloning/reset-clone))
   - Squawk: Squawk lints SQL that your migration tool applies, and its guide says to retry a migration that hits lock_timeout. The sources we reviewed do not describe running a migration or resetting data between runs. [11][7]

## Try a clone before you install anything

```
dblab clone create --username dev --password "$PASSWORD" --id test
```

The public demo runs DBLab Engine: open it with the token demo-token, create a clone and connect to it. DBLab Engine is open source, so the next step is a machine of your own.

- [Open the DBLab demo](https://demo.dblab.dev)
- [Install DBLab Engine](https://postgres.ai/docs/dblab-howtos/administration/install-dle-manually)

## Side by side

| | DBLab | Squawk |
|---|---|---|
| What it is | Thin clones of a full-size PostgreSQL database, used to run a schema change on real data before it ships. DBLab does not write, order or deploy migrations. | A linter, code formatter and language server for Postgres migrations and SQL. Its stated goal is to prevent unexpected downtime caused by database migrations. It parses the SQL text of migration files and reports rule violations. [1][2] |
| Runs the change on full-size data | Runs on full-size data: yes. DB Migration Checker applies pending migrations to a full-size clone in CI and collects statistics from the run. | Not documented in the sources we reviewed. Squawk lints SQL files, and its browser playground checks SQL locally. Its safe migrations guide says a migration that passes Squawk's lint is not automatically safe to run. [1][7] |
| Lock and downtime risk | Measures locks: yes. Measured on the clone: the checker fails a migration that holds a dangerous lock longer than a limit, 10 seconds by default. | Measures locks: partly. Predicted from the SQL, not measured. Rules flag statements that take an ACCESS EXCLUSIVE lock, such as a column type change or setting an existing column NOT NULL, plus an index built without CONCURRENTLY and migrations without a lock_timeout. [3][4][5][6][7] |
| Static review and lint rules | Lint rules: no. None. DBLab runs the change; it does not lint SQL. | Lint rules: yes. The rules page lists more than 70 rules. Some are opt-in and disabled by default. Rules can be excluded with --exclude, in a .squawk.toml file, or per statement with a squawk-ignore comment. [1][2][8] |
| Writing, versioning and deploying migrations | Deploys migrations: no. Not provided. Keep your migration tool; a clone is an ordinary PostgreSQL server that any tool can connect to. | Not documented in the sources we reviewed. Squawk lints SQL that another tool writes and applies; the docs show piping Alembic's offline SQL output into it and say it has no special support for Django or other ORMs. [11] |
| Approvals and audit trail | Approval workflow: no. Not a change-approval system. DBLab EE adds SSO, user management and audit for access to clones. | Not documented in the sources we reviewed. Findings appear in the terminal, in an editor or as a pull request comment. [1][9] |
| Rollback | Not provided for production. On a clone, reset returns the data to the snapshot, so a migration can be run again. | Not documented in the sources we reviewed. In the documented workflows Squawk lints SQL that your migration tool applies. [1][11] |
| CI integration | The checker runs in CI; the documented example uses GitHub Actions. Any pipeline can also create clones through the API or CLI. | The squawk-action GitHub Action lints migrations and can report violations as a comment on the pull request. Other CI systems can call squawk upload-to-github. The CLI has a gitlab reporter and a pre-commit hook. [1][9][10] |
| Open source and hosting | Open source: yes. Open source under Apache 2.0, self-hosted in any cloud or on-premises. | Open source: yes. Open source on GitHub with Apache 2.0 and MIT license files. It runs where you run it: CLI from npm, pip, Docker or binaries, a VS Code extension, or the browser playground. [1][12] |

## What Squawk does that DBLab does not

- Squawk checks migration SQL without a database copy: install it with npm, pip, Docker or a binary and point it at your SQL files.
- The rules page lists more than 70 rules, among them require-concurrent-index-creation, changing-column-type, constraint-missing-not-valid and require-lock-timeout.
- Each rule has a docs page with examples and reasoning, such as the lock a statement takes and the SQL to write instead.
- A GitHub Action posts violations as a comment on the pull request; the CLI also has a GitLab reporter and a pre-commit hook.
- It also runs as a language server with a VS Code extension, and as a WASM playground that checks SQL locally in the browser.

## Pricing

| Product | Plan | List price | Notes |
|---|---|---|---|
| DBLab | DBLab Engine | Free | Open source, Apache 2.0; you run it |
| DBLab | DBLab SE | From $62/month | Billed hourly by machine size, plus your own cloud costs; 2,000 GiB limit; single user |
| DBLab | DBLab EE | Custom | Annual contract, from $0.2662 per 100 GiB per hour; unlimited database size, SSO |
| Squawk | Open source | Free | Apache 2.0 and MIT license files in the repository [1] |

DBLab prices: https://postgres.ai/pricing.

## Using both

The two check the same pull request in different ways. Squawk reads the migration SQL and flags statements known to take heavy locks, before anything runs. DB Migration Checker then applies the migration to a full-size DBLab clone in CI and fails it if it holds a dangerous lock longer than the limit. Squawk catches a missing CONCURRENTLY without running anything; the clone shows how long the change takes on your real table sizes. Neither deploys the change; your migration tool still does that.

## Questions

### Is Squawk open source?

Yes. The repository on GitHub has Apache 2.0 and MIT license files. It installs from npm or pip, as binaries from the releases page, or as a Docker image. [1]

### Does Squawk need a database connection?

The documented workflows lint SQL files, and the playground checks SQL locally in the browser with a WASM build. The sources we reviewed do not describe connecting to a database. For framework migrations, the docs show generating the SQL first, for example with alembic upgrade head --sql. [1][11][13]

### If Squawk passes, is my migration safe?

Not by itself. Squawk's guide says a migration that passes its lint is not automatically safe to run, and recommends a short lock_timeout and a statement_timeout. Running the migration on a full-size DBLab clone shows its duration and locks on real data. [7]

### Can I use DBLab and Squawk together?

Yes. Lint the migration with Squawk in the pull request, and run it on a DBLab clone in CI with DB Migration Checker. Squawk does not run migrations and DBLab does not lint SQL, so each covers a step the other does not. [1][10]

## Sources for DBLab

- [DB Migration Checker](https://postgres.ai/docs/database-lab/db-migration-checker)
- [How to reset a DBLab clone](https://postgres.ai/docs/dblab-howtos/cloning/reset-clone)
- [DBLab Engine](https://postgres.ai/docs/database-lab)
- [Database migration testing](https://postgres.ai/products/database-migration-testing)

## Sources for Squawk

1. [Squawk repository and README](https://github.com/sbdchd/squawk)
2. [Squawk docs: rules overview](https://squawkhq.com/docs/rules)
3. [Squawk docs: adding-not-nullable-field](https://squawkhq.com/docs/adding-not-nullable-field)
4. [Squawk docs: require-concurrent-index-creation](https://squawkhq.com/docs/require-concurrent-index-creation)
5. [Squawk docs: changing-column-type](https://squawkhq.com/docs/changing-column-type)
6. [Squawk docs: require-lock-timeout](https://squawkhq.com/docs/require-lock-timeout)
7. [Squawk docs: applying migrations safely](https://squawkhq.com/docs/safe_migrations)
8. [Squawk docs: CLI](https://squawkhq.com/docs/cli)
9. [Squawk docs: GitHub integration](https://squawkhq.com/docs/github_app)
10. [squawk-action repository](https://github.com/sbdchd/squawk-action)
11. [Squawk docs: web frameworks](https://squawkhq.com/docs/web-frameworks)
12. [Squawk releases](https://github.com/sbdchd/squawk/releases)
13. [Squawk docs: quick start](https://squawkhq.com/docs/)

## How we compare

These pages compare what each product does for PostgreSQL; other databases and the rest of the stack are out of scope. What we say about the other product comes from its own documentation, pricing page, changelog or source repository, read on the date shown; each row cites its source. "Not documented" means we did not find it in those sources, not that the product cannot do it. Prices are list prices and the billing units differ, so they are not a total-cost comparison. Product names are trademarks of their owners.
