Skip to content

Commit

Permalink
Add a new docs page 'Querying Columns'
Browse files Browse the repository at this point in the history
  • Loading branch information
gastlich committed Oct 24, 2023
1 parent 860eedb commit 8b660f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions docs/customization/querying-columns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Querying columns with SQL

The model `int_all_columns` ([source](https://github.com/dbt-labs/dbt-project-evaluator/tree/main/models/marts/core/int_all_columns.sql)), created with the package, lists all the columns from all the dbt nodes (models, sources, seeds, snapshots, analyses)

You can you use this model to answer questions like:

- Are there any columns with the same name in different nodes?
- Are there any columns without a description?
- Are there any columns with the same name but different descriptions?
- Are there any columns with names matching a regex?
- Have any forbidden names been used for columns?


## Defining additional tests that match your exact requirements

- writing a model with `ref(int_all_columns)` with custom tests added for a specific use case
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ models:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- unique_id
- column_name
- name
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ models:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- unique_id
- column_name
- name

- name: stg_sources
description: "Staging model from the graph variable, one record per source resource."
Expand Down

0 comments on commit 8b660f4

Please sign in to comment.