Skip to main content

dre_core/
lib.rs

1//! DRE core: turns a project directory into a resolved, validated project, and runs it.
2
3pub mod catalog;
4pub mod codes;
5pub mod coltypes;
6pub mod config;
7pub mod constraints;
8pub mod dates;
9pub mod diag;
10pub mod dialect;
11pub mod document;
12pub mod engine;
13pub mod error;
14pub mod for_each;
15pub mod fs;
16pub mod lock;
17pub mod lookups;
18pub mod manager;
19pub mod manifest;
20pub mod message;
21mod mutable;
22pub mod no_data;
23pub mod numbers;
24pub mod occurrences;
25pub mod options;
26pub mod packages;
27pub mod parse;
28pub mod plugins;
29pub mod preflight;
30pub mod profiles;
31pub mod project;
32pub mod query;
33pub mod rate;
34pub mod release;
35pub mod render;
36pub mod rows;
37pub mod run;
38pub mod run_results;
39pub mod runs;
40pub mod saved;
41pub mod schedule;
42mod schema;
43pub mod secret_columns;
44pub mod secrets;
45pub mod selector;
46pub mod settings;
47pub mod sqlsplit;
48pub mod target;
49pub mod template_file;
50pub mod values;
51pub mod variables;
52pub mod yaml;
53pub mod zip_pack;
54
55pub use diag::{Diagnostic, Diagnostics, Severity};
56
57/// The version string `dre --version` prints. DRE has no released version yet.
58pub fn version() -> &'static str {
59    match env!("CARGO_PKG_VERSION") {
60        "0.0.0" => "unreleased",
61        v => v,
62    }
63}
64
65/// DRE's home directory: `~/.dre`.
66pub fn dre_home() -> std::path::PathBuf {
67    std::env::home_dir().unwrap_or_default().join(".dre")
68}
69
70/// A path with `/` separators on every platform, so messages and goldens read the same everywhere.
71pub fn slash(p: &std::path::Path) -> std::path::PathBuf {
72    std::path::PathBuf::from(p.to_string_lossy().replace('\\', "/"))
73}