Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 640 Bytes

CONTRIBUTING.md

File metadata and controls

19 lines (16 loc) · 640 Bytes

Implementing a new check

Write a new SQL query

Each database structure check starts with an SQL query to the pg_catalog.

  1. SQLFluff is used as a linter for all sql queries
  2. All queries should be schema-aware, i.e. we filter out database objects on schema basis:
    where
        nsp.nspname = :schema_name_param::text
  3. All tables and indexes names in the query results should be schema-qualified. We use ::regclass on oid for that.
    select
        psui.relid::regclass::text as table_name,
        psui.indexrelid::regclass::text as index_name,