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 JOIN clauses.
  • Auto-Flattening: Build wide "Gold" tables (Marts) automatically by traversing the relationship graph.
  • Automated DDL: Automatically generate CREATE VIEW (for sources) and CREATE 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 .sqlcad files.

Guides

Installation

git clone https://github.com/your-repo/sqlcad.git cd sqlcad uv sync