Concepts
- Report: one or more Jinja-templated SQL queries plus an output config, declared in YAML.
A
.sqlfile underreports/with no YAML is an unmanaged report, meant for quick tests. - Set and Binding: one report can run as many named variants (clients, regions, departments). A Binding is a report paired with a Set, with its own profile, variables, query subset and output.
- Jinja everywhere: SQL, paths and options render with
var(),env_var(),run.*and your macros inmacros/.target.*andprofile('name')read connection settings, so names can follow the environment:{{ target.catalog }}.{{ target.schema }}.orders.run.dateis a date you can navigate (run.date.prev_month.start.date), in the run’s timezone (UTC unless you set one).run_query()andcolumns()let a macro query the report’s own connection while rendering.ref('file')reuses another.sqlfile as a subquery. See templates. - Lookups: mapping tables you maintain as files in
lookups/(csv, xlsx, xls, json, jsonl, yml) rather than in the database.ref('countries')makes one usable like a table: small ones are inlined into the SQL, larger ones (over 200 rows by default) are loaded into a temp table by the source plugin.lookup('countries')hands the rows to Jinja. Values are text unless alookups/<name>.ymlconfig gives columns types; see lookups. - Plugins: every source, format and destination is a plugin that speaks DRE’s
plugin protocol. Plugins ship in packages, one per system:
databricksis the Databricks source and destination,object_storeis S3, GCS and Azure Blob. A project declares each package once and DRE installs it on demand. - Delivery: one output can go to several destinations in a single run, e.g. object storage (S3, GCS, Azure Blob), SFTP/FTP, Databricks Volumes or workspace files, an email with the file attached, or a Slack channel. See plugins.
- Logs: every run appends to
logs/dre.login the project, including the full SQL of each statement sent to the database (report queries,run_query(), lookup loads). The file rotates every 10,000 lines, keepingdre.log.1todre.log.5. - Verification:
dre validatechecks the project and compiles its SQL; with-sit also shows, per selected Binding, the compiled files, the source and target, the output file and every destination (non-dev targets stand out).dre compilejust renders the SQL intotarget/compiled/and lists the files.dre validate --livechecks every statement against the database.--previewand schema-drift detection check a report before it reaches anyone. - Generated files: everything DRE writes goes in the target path,
target/in the project by default: compiled SQL, each run’s output files, schema snapshots,run_results.jsonand the manifest.--target-path,DRE_TARGET_PATHortarget_path:indre_project.ymlmove it (see below). - Selecting:
run,compile,validateandlstake report names,tag:<tag>, folder names or dotted folder paths, as arguments (dre run daily monthly) or with-s/--select. Several match any of them:-s daily monthly,-s daily,monthly, or repeated-s(a semicolon works too, quoted:-s "daily;monthly").