Skip to content

Referential integrity (FK exists in parent)

foreign_key - Column-level - Common column checks

Validates that values in a column exist in a parent table's column.

Parameters

Parameter Type Default Required Description
reference_table str none Yes The parent table name.
reference_column str none Yes The parent column name.
threshold_percent float 0.0 No Maximum allowed percentage of orphaned records.
max_orphan_examples int 10 No Maximum number of orphan examples to return in the details.

YAML example

checks:
  - name: example_foreign_key
    check_type: foreign_key
    table_name: schema.table
    column_name: example_column
    parameters:
      reference_table: <reference_table>
      reference_column: <reference_column>
      threshold_percent: 0.0
      max_orphan_examples: 10

See YAML check format for the full field reference.