Each database structure check starts with an SQL query to the pg_catalog.
- SQLFluff is used as a linter for all sql queries
- All queries should be schema-aware, i.e. we filter out database objects on schema basis:
where nsp.nspname = :schema_name_param::text
- All tables and indexes names in the query results should be schema-qualified.
We use
::regclass
onoid
for that.select psui.relid::regclass::text as table_name, psui.indexrelid::regclass::text as index_name,