Skip to main content

ReportFile

Struct ReportFile 

Source
pub struct ReportFile {
Show 17 fields pub name: Option<Located<Loose<String>>>, pub description: Option<Located<Loose<String>>>, pub meta: Option<Located<Loose<Map<String, Value>>>>, pub tags: Option<Located<Loose<Vec<String>>>>, pub queries: Option<Located<Loose<Vec<QueryItem>>>>, pub output: Option<IgnoredAny>, pub profile: Option<Located<Loose<String>>>, pub sets: Option<Located<Loose<Vec<SetItem>>>>, pub default_set: Option<Located<Loose<String>>>, pub vars: Option<Located<Loose<Map<String, Value>>>>, pub var_schema: Option<Located<Loose<Definitions>>>, pub timezone: Option<Located<Loose<String>>>, pub locale: Option<Located<Loose<String>>>, pub plugins: Option<IgnoredAny>, pub sources: Option<IgnoredAny>, pub schedule: Option<Located<IgnoredAny>>, pub unknown: UnknownKeys,
}
Expand description

A report: SQL queries plus an output, in a YAML file under reports/.

Fields§

§name: Option<Located<Loose<String>>>

The report’s name. Default: the name of the folder the YAML file is in. Report names are unique across the project.

§description: Option<Located<Loose<String>>>

What this report answers, including its business definitions and units.

§meta: Option<Located<Loose<Map<String, Value>>>>

Metadata for external tools. DRE checks its shape, not the meaning of its keys.

§tags: Option<Located<Loose<Vec<String>>>>

Tags to select the report with, -s tag:<tag>.

§queries: Option<Located<Loose<Vec<QueryItem>>>>

The .sql files whose results make the report’s tabs, in the order they run, on one database session.

§output: Option<IgnoredAny>

One output, or a list of outputs formatted from the same run of the queries (file outputs are delivered before messages). A list replaces the inherited output; a map changes it.

§profile: Option<Located<Loose<String>>>

The connection (in profiles.yml) the queries run on, unless a query’s own profile: or a source’s says otherwise. Default: the folder’s +profile, then default_profile. Can’t be combined with sets. May use Jinja with var(), env_var(), run.* and target.name.

§sets: Option<Located<Loose<Vec<SetItem>>>>

The Sets the report can run as, by name (declared in sets.yml) or declared here.

§default_set: Option<Located<Loose<String>>>

The Set a plain dre run uses. Must be one of sets.

§vars: Option<Located<Loose<Map<String, Value>>>>

Variables, read in SQL and YAML with var('name'). Values can be strings, numbers, booleans, lists or maps.

§var_schema: Option<Located<Loose<Definitions>>>

Optional declarations for variables: type, default, allowed values, description and required. Kept separate from vars so a map-valued variable remains a plain value.

§timezone: Option<Located<Loose<String>>>

The timezone run.date and run.now use, an IANA name such as Australia/Sydney. Default: UTC.

§locale: Option<Located<Loose<String>>>

The locale this report’s number filters format for (de-DE). Default: the folder’s +locale, then the project’s locale, then en.

§plugins: Option<IgnoredAny>

The plugin packages this project uses. DRE installs them on demand into dre_deps/ and pins them in dre.lock. May be written in any project YAML file; dependencies.yml is the usual place.

§sources: Option<IgnoredAny>

dbt-style source declarations (see the sources schema). May be written in any project YAML file.

§schedule: Option<Located<IgnoredAny>>

Removed: schedules live in schedules.yml. Read only to say so.

§unknown: UnknownKeys

Trait Implementations§

Source§

impl Default for ReportFile

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ReportFile

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for ReportFile

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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, 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.