Models are Python
A model is a function decorated with @model that returns a query built from sources, refs, and components.
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.
MERGE (DuckDB and PostgreSQL)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.