Skip to content

postgres

Postgres migrations that do not lock tables or break running code, run in order, and never change after they ran, and schemas with row security, explicit grants, and an index under every foreign key. It requires sql.

Check Stage Level What it does
postgres/squawk commit recommended Checks every migration for changes that lock or rewrite a table, or break the running application.
postgres/migration-order commit recommended Checks that every migration has a version, that no two share one, and that a new migration sorts after the committed ones.
postgres/edited-migrations commit recommended Checks that no migration at or before postgres.frozen_through differs from its committed text.
postgres/row-level-security commit recommended Checks that every table in a client schema turns on row level security.
postgres/grants commit recommended Reports a migration that grants all privileges.
postgres/definer-search-path commit recommended Checks that every SECURITY DEFINER function sets its search_path.
postgres/foreign-key-indexes commit recommended Checks that an index, a primary key, or a unique key leads with every foreign key column.
Setting What it sets
postgres.client_schemas The schemas clients reach, where every table needs row level security.
postgres.frozen_through The last migration version that has run everywhere (none, all, or a version); Squawk skips those migrations, and they may not change.
postgres.migrations_folder The migrations folder, relative to the repository root; without it, the checks use the migration files of this configuration.
tools.squawk.assume_in_transaction Whether the migration runner wraps every migration in a transaction; the supabase configuration turns it on.

gspot selects it in a scope with file prisma/schema.prisma matches (?:^|\n)[\t ]*provider[\t ]*=[\t ]*"postgresql", or dependencies pg, postgres, psycopg, asyncpg, @neondatabase/serverless. A configuration that requires it selects it too: supabase.

Setting Value
tools.sqlfluff.dialect "postgres"
Rule file Installed when
.gspot/configurations/database/postgres/rules/POSTGRES.md Always
Tool Version
squawk 2.64.0

gspot writes .gspot/configurations/database/postgres/squawk.toml.