Skip to main content

QueryEntry

Struct QueryEntry 

Source
pub struct QueryEntry {
    pub query: Option<Loose<String>>,
    pub profile: Option<Loose<String>>,
    pub tab: Option<Loose<bool>>,
    pub tab_name: Option<Loose<String>>,
    pub anchor: Option<Loose<String>>,
    pub header: Option<Loose<bool>>,
    pub columns: Option<Value>,
    pub on_empty: Option<Loose<OnEmpty>>,
    pub secret_columns: Option<Loose<Vec<String>>>,
    pub autofit: Option<Loose<bool>>,
    pub style: Option<Value>,
    pub unknown: UnknownKeys,
}
Expand description

A query with settings, instead of just its name.

Fields§

§query: Option<Loose<String>>

The name of a .sql file under reports/, without folder or extension.

§profile: Option<Loose<String>>

The connection this query runs on, over the report’s, Set’s, folder’s and project’s. Must agree with the profile of any source it uses. May use Jinja with var(), env_var(), run.* and target.name.

§tab: Option<Loose<bool>>

false runs the file only for what it does (temp tables, SETs) and discards any result, so it gets no tab.

§tab_name: Option<Loose<String>>

The tab (sheet) name. Default: the file’s name. Not allowed with tab: false.

§anchor: Option<Loose<String>>

Where the data starts on the sheet (xlsx only). Default: A1.

§header: Option<Loose<bool>>

Whether to write the column names as the first row (xlsx only). Default: the output’s header.

§columns: Option<Value>

Per-column settings for this tab, by column name (xlsx only).

§on_empty: Option<Loose<OnEmpty>>

When this query returns no rows: continue keeps its empty tab or section, skip leaves its tab (or per-query file) out, fail fails the run. Wins over the output’s on_empty. Default: the output decides once every query is empty.

§secret_columns: Option<Loose<Vec<String>>>

Columns whose values are secrets (a PDF or zip password): values of 4 or more characters are masked as ***** in the console, logs, run_results.json, rows.jsonl, --output-json and previews. Never masked in delivered files or messages.

§autofit: Option<Loose<bool>>

Size this tab’s columns from their content (xlsx only), over the output’s autofit. Default: the output’s, which is on.

§style: Option<Value>

How this tab looks (xlsx only), over the output’s style: font, header, totals, banded_rows, borders, and cell keys (bold, fill, …) for every data cell. See the xlsx plugin page.

§unknown: UnknownKeys

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for QueryEntry

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 QueryEntry

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.