SqlCAD Documentation
Welcome to the documentation for SqlCAD (SQL Computer Aided Design).
SqlCAD is a compiler for data warehouse modeling. It allows you to define your data model as a graph of Entities and Relationships, and then automatically generates optimized, flattened SQL for your target data warehouse.
Why SqlCAD?
- Graph-First: Define joins once, use them everywhere. No more copy-pasting
LEFT JOINclauses. - Auto-Flattening: Build wide "Gold" tables (Marts) automatically by traversing the relationship graph.
- Automated DDL: Automatically generate
CREATE VIEW(for sources) andCREATE TABLE(for entities) statements, managing file reading and schema creation. - Point-in-Time Correct: Built-in support for SCD Type 2 history and correct temporal joins (AS OF logic).
- Strongly Typed: Validates schemas and column dependencies before you run any SQL.
Getting Started
- Tutorial: Build a complete data warehouse from scratch.
- Concepts: Understand the Source -> Silver -> Gold architecture.
- Schema Evolution: Using the Diff Engine and declarative schema management.
- Reference: Syntax guide for
.sqlcadfiles.
Guides
- Loading Strategies: Learn about SCD2 and Incremental Marts.
- Features & ML: How to build Point-in-Time correct features.
- Data Lineage: Visualize dependencies and trace column provenance.
- Observability: Statistics collection and data quality assertions.
- Warehouses: Configuration for DuckDB, BigQuery, and Snowflake.
- Comparison: How SqlCAD differs from dbt and SQLMesh.
Installation
git clone https://github.com/your-repo/sqlcad.git cd sqlcad uv sync