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 engine;
12pub mod error;
13pub mod fs;
14pub mod lock;
15pub mod lookups;
16pub mod manager;
17pub mod manifest;
18pub mod message;
19mod mutable;
20pub mod numbers;
21pub mod occurrences;
22pub mod options;
23pub mod packages;
24pub mod parse;
25pub mod plugins;
26pub mod preflight;
27pub mod profiles;
28pub mod project;
29pub mod query;
30pub mod render;
31pub mod rows;
32pub mod run;
33pub mod run_results;
34pub mod runs;
35pub mod schedule;
36mod schema;
37pub mod secrets;
38pub mod selector;
39pub mod settings;
40pub mod sqlsplit;
41pub mod target;
42pub mod values;
43pub mod variables;
44pub mod yaml;
45
46pub use diag::{Diagnostic, Diagnostics, Severity};
47
48/// The version string `dre --version` prints. DRE has no released version yet.
49pub fn version() -> &'static str {
50    match env!("CARGO_PKG_VERSION") {
51        "0.0.0" => "unreleased",
52        v => v,
53    }
54}
55
56/// DRE's home directory: `~/.dre`.
57pub fn dre_home() -> std::path::PathBuf {
58    std::env::home_dir().unwrap_or_default().join(".dre")
59}
60
61/// A path with `/` separators on every platform, so messages and goldens read the same everywhere.
62pub fn slash(p: &std::path::Path) -> std::path::PathBuf {
63    std::path::PathBuf::from(p.to_string_lossy().replace('\\', "/"))
64}