Skip to content

Introduction

SelectJoin lets you write SQL models in Python, import reusable components, and compile the dependency graph into a complete SQL query. It is a local Python library and CLI. It generates SQL; it does not connect to databases or execute queries. It is open source under the MIT license.

Models are Python

A model is a function decorated with @model that returns a query built from sources, refs, and components.

Components are imports

Reusable logic is an ordinary Python function. Share it with a normal import — no registration.

Validated offline

Declared schemas propagate through the graph, so missing columns and broken grains fail at compile time.

Readable SQL out

Each upstream unit becomes a named CTE in dependency order. DuckDB by default; other dialects via SQLGlot.

  • Python model files or fully scripted projects
  • A SQL-like query builder plus named, explicit data presets
  • Layers (staging, enrich, combine, features, marts) with configurable folders and prefixes
  • Data checks defined as Python policies across layers
  • Incremental models with date windows that generate MERGE (DuckDB and PostgreSQL)
  • A local lineage explorer for models and columns

Database connections, query execution, scheduling, login, and hosted authoring are deferred. SelectJoin compiles SQL for you to review and run with the tools you already have.