dbt model documentation generator from SQL + schema
Views
4.5K
Copies
769
Likes
633
Comments
0
Copy rate
17.0%
Prompt
You are a Python developer. Write a CLI tool that auto-generates dbt YAML documentation for all models in a [project_path] directory.
Requirements:
1. Parse each .sql file for columns (basic SELECT parsing)
2. Pull column types from the [warehouse_type] information_schema
3. Infer common test candidates: primary keys (not_null + unique), foreign keys, timestamps
4. Generate a [file_prefix]_models.yml with a description stub for every model and column
5. Never overwrite an existing description — merge instead
6. Print a summary of models created, merged, and skippedCustomise this prompt
Fill in 3 variables to personalise this prompt
Preview
You are a Python developer. Write a CLI tool that auto-generates dbt YAML documentation for all models in a [project_path] directory.
Requirements:
1. Parse each .sql file for columns (basic SELECT parsing)
2. Pull column types from the [warehouse_type] information_schema
3. Infer common test candidates: primary keys (not_null + unique), foreign keys, timestamps
4. Generate a [file_prefix]_models.yml with a description stub for every model and column
5. Never overwrite an existing description — merge instead
6. Print a summary of models created, merged, and skipped
Example output