Information Type
Retrieved From
Singular tests
C. .sql files
Column data types
A. Data platform information schema
Generic tests
B. .yml configuration
SQL code
C. .sql files
Column descriptions
B. .yml configuration
Model dependencies
C. .sql files
The dbt docs command compiles metadata about your project by gathering information from three primary sources: your warehouse’s information schema, your YAML configuration files, and your SQL model files. Understanding which metadata comes from which source is essential for debugging and for effective documentation practices.
Singular tests live inside .sql files within the /tests directory. Since dbt renders these tests directly from SQL files, their definitions appear in documentation sourced from that location.
Column data types come from the warehouse itself. dbt introspects the data platform information schema to retrieve actual types because dbt does not infer or define column types—only the warehouse does.
Generic tests (e.g., unique, not_null, accepted_values) are declared in .yml files. These YAML definitions contain test configurations, descriptions, and parameters, which dbt uses to document and execute these tests.
SQL code for models is naturally sourced from .sql files where the models are defined. This includes logic such as SELECT statements, CTEs, and transformations.
Column descriptions are written exclusively in .yml files. dbt never extracts descriptions from SQL comments—only from YAML.
Model dependencies come from the ref() and source() calls inside .sql model files, which dbt parses to build the DAG.