Expand description
DRE core: turns a project directory into a resolved, validated project, and runs it.
Re-exports§
pub use diag::Diagnostic;pub use diag::Diagnostics;pub use diag::Severity;
Modules§
- catalog
- Live relation context for integrations. Descriptions are read from the database; DRE does not create or maintain upstream comments.
- codes
- Every diagnostic and error code DRE reports, in one registry.
- coltypes
- How
dre validate --livecompares a declared source column’sdata_typewith what the database returns (an Arrow type, as the source plugin delivers it). The comparison is loose: a declared SQL type matches a family of Arrow types (bigint≈Int64,varchar(20)≈Utf8), since plugins map database types to Arrow in their own ways. Documented indocs/sources.md. - config
- Reading DRE’s YAML files into typed config.
- constraints
- Plugin version constraints: intersecting semver requirements and detecting contradictions.
- dates
- Calendar values for templates:
run.date,run.now,date(),datetime()and the periods built from them. Everything is worked out at render time, so compiled SQL holds literals and a rerun with the sameDRE_RUN_DATErenders the same text. - diag
- Validation diagnostics: every problem found in one pass, with file and line where known.
- engine
- The run engine’s parts around a Binding’s run (
crate::run): - error
- DRE’s error type at module boundaries: a registered
Code(whoseKinddecides the exit code and whether trying again can help), the message, and an optional hint at the fix. - fs
- Writing DRE’s durable state:
write_atomicfor every file a later run, or another tool, reads back (run_results.json, the drift snapshot, the manifest,dre.lock, plugin and package metadata). A forced stop mid-write leaves the previous or the next complete file, never broken JSON. Report outputs aren’t state and are written as they are. - lock
dre.lock: the exact plugin versions and package commits a project resolved, committed alongside it.- lookups
- Lookups: small tables kept as files under
lookups/(mapping tables, code lists), used in SQL throughref('name')without ever being written to the source database by the user. - manager
- The plugin manager: a static JSON registry index of plugin packages, checksum-verified
downloads, side-by-side versioned installs, and
dre.lock. - manifest
- The project manifest,
<target>/manifest.json: everything a project declares, as the engine resolves it, for orchestrators, CI and other tools. It’s a deliberate projection of the loadedProject, not a dump: built offline (no connection, no profiles, no plugins), the same bytes for the same project and the same inputs on every OS, and free of secrets and machine-specific values. - message
- The built-in
messageformat: a Binding’s query results rendered through Jinja into a short headline, a title plus text in portable Markdown (dre_protocol::markdown). - numbers
- Number filters for every template:
number,percent,signed,currencyandcompact, formatted for the run’slocale:. - occurrences
- Schedule occurrences: when each schedules.yml entry fires within a window, and the exact
command that runs each firing (
dre schedule ls). Pure computation over the loaded project: no profiles, plugins, network or writes. Storing, diffing and dispatching occurrences is the caller’s business. - options
- Plugin options: a format’s
output:keys and a destination entry’s keys. Core owns only the keys every output shares (format,destination,template,extension,profile,path); everything else belongs to the plugin, which checks it (the protocol’svalidate). A new format or destination therefore needs no change to core. - packages
- Macro packages: reusable macros from another project (e.g.
dre_utils), declared underpackages:in the project’s rootdependencies.ymlorpackages.yml: - parse
- The parse pass: each Binding rendered without a database, as dbt’s parse finds
ref()andsource(), to learn every query’s sources and the connection it runs on. Its results feed selection (-s source:), the manifest,dre lsanddre validate, none of which connect; a run repeats it with its own inputs and then holds rendering to what it found. - plugins
- Finding installed plugin packages.
- preflight
- Jinja pre-flight: syntax checks and static scans of
var(),env_var()andrun.*call sites. Nothing is rendered with live values here. - profiles
profiles.yml: connection definitions, kept outside the project.- project
- Loading a DRE project directory into a resolved, validated project.
- query
- A single read-only query on a configured connection, for external integrations.
- render
- Runtime Jinja rendering: one environment per connection a Binding uses (its queries’ SQL) plus
one for output paths and template values. Provides
run.*,var(),env_var(),run_query(),columns(),ref(),source(),target.name,connection.*,destination.*,profile(), the calendar functions incrate::datesand every macro inmacros/. - rows
- Typed, streaming JSON row export for integrations. Decimals retain their exact text; columns carry Arrow types so consumers need not infer types from values or CSV.
- run
- The run path: turn a resolved project into delivered files.
- run_
results run_results.json: what one run of one Binding did. A public, versioned contract (docs/run-results.schema.jsonis generated from these types): adding an optional field keepsSCHEMA_VERSION; removing, renaming or re-typing one, or changing what it means, bumps it (a minor DRE release before 1.0, a major one after).- runs
- A Binding’s run folders, so overlapping and interrupted runs are safe:
- schedule
- Schedule timings: their shape, and the checks shared by
dre validateanddre schedule ls. Core never fires schedules;occurrencesworks out when they would. - secrets
- Secret masking. The value of every environment variable named
DRE_SECRET_*is replaced by*****in everything DRE writes for people to read: the console,logs/dre.log, JSON events,run_results.jsonand the compiled SQL intarget/compiled/. The SQL actually sent to the database is unchanged.mask_secrets: falseindre_project.ymlturns masking off. - selector
- Selector resolution, shared by
dre validate(schedules.yml) anddre run. - settings
- DRE’s settings and where each value came from.
- sqlsplit
- Statement splitting: lexing
;-separated SQL, not parsing it. - target
- The target path: the folder DRE writes its generated files to (compiled SQL, run outputs,
schema snapshots,
run_results.json, the manifest).target/in the project root unless set, highest first, by--target-path,DRE_TARGET_PATHortarget_path:indre_project.yml. It’s always a local (or mounted) path, never inside the project’s sources. - values
- Arrow values as Jinja values, for
run_query()rows and message results. - variables
- Optional variable declarations, separate from
varsso existing map values keep their meaning. - yaml
- YAML loading with file/line locations for diagnostics.