Measure C1 (branch) coverage of dbt SQL models — directly inside Snowflake.
CI/CD ready via stored procedure. Zero infrastructure.
# Call the stored procedure from your CI/CD pipeline snowsql -q "CALL code.analyze_coverage('TARGET_DB', 'dbt_schema', '{}')" [OK] fact_sales 100.0% (5/5 branches) [OK] dim_customers 92.3% (12/13 branches) [FAIL] customer_segmentation 66.7% (2/3 branches) └─ L12: segment = 'New' ← uncovered branch [OK] Overall: 93.75% coverage
SELECT customer_id, CASE WHEN total_purchases > 10 THEN 'VIP' ✓ True WHEN total_purchases > 3 THEN 'Regular' ✓ True ELSE 'New' ✗ never reached END AS segment FROM customers WHERE status = 'active' AND created_at >= '2023-01-01' -- ↑ WHERE clause as a whole: True ✓ | False ✗
Each condition (CASE WHEN, WHERE clause) must be evaluated as both True and False. AND/OR sub-conditions are not tracked individually — the full WHERE expression is one branch.
Analyzes CASE WHEN, WHERE, and boolean conditions in dbt SQL. Measures True/False coverage per expression — not per sub-condition.
Runs entirely inside your Snowflake account. No external services, no data leaves your environment. Deployed via Snowflake Marketplace.
Integrate coverage checks into any CI/CD pipeline by calling the Snowflake stored procedure. Returns structured JSON results for downstream processing.
JSON (machine-readable), JUnit XML (CI integration), Markdown (PR comments), and HTML (visual browser report).
Built-in Streamlit dashboard for interactive analysis, run history, and HTML report download.
Full Japanese and English support across UI, error messages, and report output.
Fine-grained control with .dbt-coverage.yml to exclude models, schemas, or specific conditions from analysis.
Run dbt compile and upload the target/ directory as target.zip to your Snowflake Stage.
dbt compile Compress-Archive -Path ./target -DestinationPath target.zip snowsql ... PUT file://target.zip @dbt_coverage_app.code.dbt_artifacts
Call the analyze_coverage stored procedure — from CI/CD script or the Streamlit UI.
CALL code.analyze_coverage( '@dbt_coverage_app.code.dbt_artifacts/target.zip', '*', -- model selector 'api', -- caller 'en' -- language );
Receive a detailed JSON report. Export as JUnit XML for CI, Markdown for PR comments, or HTML for visual review.
{
"status": "success",
"summary": {
"coverage_rate_percent": 93.75,
"models_passed": 5,
"models_failed": 1
},
"models": [ ... ]
}
name: dbt Coverage Analysis on: [push, pull_request] jobs: coverage: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run coverage analysis run: | snowsql -q "CALL code.analyze_coverage( \ 'TARGET_DB', 'dbt_schema', '{}')" \ -o output_format=json - uses: actions/upload-artifact@v4 with: name: coverage-reports path: coverage_reports/
# Call the stored procedure directly with snowsql snowsql -q "CALL code.analyze_coverage('TARGET_DB', 'dbt_schema', '{}')" ` -o output_format=json # Parse the JSON result and use exit code on your CI/CD side # 0 = success, non-zero = error
All functionality is exposed as Snowflake Stored Procedures — callable from any SQL client, BI tool, or script.
code.analyze_coverageCALL code.analyze_coverage( stage_path, -- '@.../target.zip' model_selector, -- '*' or 'fact_sales' caller, -- 'api' for CI/CD lang -- 'en' or 'ja' );
code.list_historyCALL code.list_history(20); -- Returns last 20 runs with -- coverage rates, timestamps, -- model counts, and status.
code.generate_html_reportCALL code.generate_html_report( result_json, -- from analyze_coverage lang -- 'en' or 'ja' ); -- Returns full HTML string
Snowflake Marketplace 公開準備中。外部インフラ不要。