Skip to main content

Project

Struct Project 

Source
pub struct Project {
Show 36 fields pub name: String, pub root: PathBuf, pub target_dir: PathBuf, pub target_source: Source, pub target_name: String, pub target_from: TargetSource, pub default_profile: Option<String>, pub default_profile_line: Option<usize>, pub default_set: Option<String>, pub vars: Map<String, Value>, pub run_query_max_rows: u64, pub format_options: BTreeMap<String, Map<String, Value>>, pub reports: Vec<Report>, pub sets: BTreeMap<String, SetDef>, pub plugins: Vec<PluginRequirement>, pub plugin_uses: Vec<PluginUse>, pub plugins_incomplete: bool, pub schedules: Vec<ScheduleEntry>, pub timings: BTreeMap<String, Timing>, pub macros: Vec<PathBuf>, pub packages: Vec<Package>, pub mask_secrets: bool, pub timezone: Option<String>, pub locale: Option<String>, pub week_start: WeekStart, pub week_numbering: WeekNumbering, pub dispatch: DispatchOrder, pub sql: BTreeMap<String, PathBuf>, pub lookups: BTreeMap<String, Lookup>, pub lookup_inline_max_rows: u64, pub folders: Vec<Vec<String>>, pub files: Vec<PathBuf>, pub parse_errors: BTreeMap<String, Vec<Diagnostic>>, pub inputs: Inputs, pub sources: BTreeMap<String, SourceDef>, pub profiles: Profiles,
}

Fields§

§name: String§root: PathBuf§target_dir: PathBuf

The folder DRE writes its generated files to (compiled SQL, run outputs, schema snapshots, run_results.json, the manifest): target/ in the root by default.

§target_source: Source

Where the target path was set, for messages.

§target_name: String

The run’s target (environment): --target, DRE_TARGET, else dev; target.name in templates. Each profile’s entry is crate::profiles::Profiles::target_of.

§target_from: TargetSource

Where target_name came from.

§default_profile: Option<String>§default_profile_line: Option<usize>

Its line in dre_project.yml, for messages.

§default_set: Option<String>§vars: Map<String, Value>§run_query_max_rows: u64§format_options: BTreeMap<String, Map<String, Value>>

format_options:: per format, defaults under every output of that format.

§reports: Vec<Report>§sets: BTreeMap<String, SetDef>§plugins: Vec<PluginRequirement>

The declared plugin packages.

§plugin_uses: Vec<PluginUse>

Every plugin the project uses, checked against the declared packages once they’re installed (crate::plugins::check_uses).

§plugins_incomplete: bool

Some package’s declarations conflict, so it’s missing from plugins.

§schedules: Vec<ScheduleEntry>§timings: BTreeMap<String, Timing>

Named timings from timings.yml, which schedules use with timing:.

§macros: Vec<PathBuf>

Macro files under macros/, relative to the root.

§packages: Vec<Package>

Macro packages, each called through its name ({{ dre_utils.x() }}).

§mask_secrets: bool

Mask DRE_SECRET_* values in logs and records (default true).

§timezone: Option<String>

The project’s default timezone: (IANA name); runs default to UTC without one.

§locale: Option<String>

The project’s locale: for the number filters; en without one.

§week_start: WeekStart

week_start: and week_numbering:, for the calendar functions.

§week_numbering: WeekNumbering§dispatch: DispatchOrder

dispatch: search orders, by macro namespace.

§sql: BTreeMap<String, PathBuf>

Every uniquely named .sql file under reports/, by basename: what ref() resolves.

§lookups: BTreeMap<String, Lookup>

Lookups under lookups/, which ref() also resolves.

§lookup_inline_max_rows: u64

A lookup with more rows than this is loaded into a temp table rather than inlined.

§folders: Vec<Vec<String>>

Every folder under reports/, as path segments.

§files: Vec<PathBuf>

The project’s own files, relative to the root with forward slashes, sorted: every YAML file (not a root profiles.yml) and everything under reports/, macros/ and lookups/.

§parse_errors: BTreeMap<String, Vec<Diagnostic>>

Templates the load’s parse pass couldn’t render, by report: they make the report invalid in the manifest. Its own run, compile or validate reports them.

§inputs: Inputs

What the load’s parse pass rendered with: the target, --var, the run date and timezone.

§sources: BTreeMap<String, SourceDef>

Declared sources (dbt’s sources:), by name.

§profiles: Profiles

Implementations§

Source§

impl Project

Source

pub fn report(&self, name: &str) -> Option<&Report>

Source

pub fn run_target(&self) -> RunTarget

The run’s target and where it came from.

Trait Implementations§

Source§

impl Clone for Project

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Project

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for Project

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.