Skip to content
/ dag Public

Compile SQL into binaries with DAG-aware dependency execution using DuckDB.

License

Notifications You must be signed in to change notification settings

mo42/dag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dag

dag is a lightweight SQL build orchestrator.

It analyzes dependencies between SQL files, detects cycles, determines a correct execution order, and then builds and runs each query using an existing SQL-to-C++ compiler (sqlc).

Motivation

An ML pipeline can consist of many preparatory SQL queries with complex transformations and dependencies. For example:

  • source.sql produces source.csv
  • transform.sql references source.csv
  • final.sql reads transform.csv

Manually managing execution order quickly becomes error-prone.

dag solves this by scanning for SQL files, inferring dependencies, detecting cycles, compiling and executing queries in the correct order.

Usage

./dag
Usage:
  dag compile <dir>
  dag run <dir>

Example

./dag compile test-simple-number
[compile] numbers
[compile] squares
[compile] summary
./dag run test-simple-number
[run] numbers
[run] squares
[run] summary

About

Compile SQL into binaries with DAG-aware dependency execution using DuckDB.

Resources

License

Stars

Watchers

Forks