Skip to main content

TabularDatabase

Struct TabularDatabase 

Source
pub struct TabularDatabase {
    pub name: Option<String>,
    pub tables: Vec<Table>,
    pub relationships: Vec<Relationship>,
    pub roles: Vec<Role>,
    pub expressions: Vec<SharedExpression>,
    pub functions: Vec<Function>,
}
Expand description

Normalized semantic model, regardless of source format (TMDL, model.bim, .pbix DataModelSchema). Downstream code never branches on source format.

Fields§

§name: Option<String>

Model name, when the source format records one.

§tables: Vec<Table>

Tables in source order.

§relationships: Vec<Relationship>

Relationships between table columns.

§roles: Vec<Role>

Row-level-security roles.

§expressions: Vec<SharedExpression>

Model-level shared M expressions (TMDL expressions.tmdl / TMSL model.expressions): Power Query parameters and shared queries.

§functions: Vec<Function>

User-defined DAX functions (TOM functions). Names are model-global.

Implementations§

Source§

impl TabularDatabase

Handle dereferencing: turning a positional handle from ModelIndex back into the object it points at.

Every accessor goes through .get() and returns Option. A handle is only meaningful against the database its index was built from, and a handle from a different or since-mutated database is a normal miss, never a panic.

Source

pub fn table(&self, h: TableHandle) -> Option<&Table>

The table a handle points at, or None if the handle is stale.

Source

pub fn column(&self, h: ColumnHandle) -> Option<&Column>

The column a handle points at, or None if either index is out of range.

Source

pub fn measure(&self, h: MeasureHandle) -> Option<&Measure>

The measure a handle points at, or None if either index is out of range.

Source

pub fn hierarchy(&self, h: HierarchyHandle) -> Option<&Hierarchy>

The hierarchy a handle points at, or None if either index is out of range.

Source

pub fn shared_expression( &self, h: ExpressionHandle, ) -> Option<&SharedExpression>

The shared M expression a handle points at, or None if the handle is stale.

Source

pub fn function(&self, h: FunctionHandle) -> Option<&Function>

The user-defined function a handle points at, or None if the handle is stale.

Source

pub fn object_id(&self, r: Resolved) -> Option<ObjectId>

The stable graph-node identity of a resolved reference.

Names come from the objects themselves, so the id carries the model’s own casing for display; ObjectId still compares case-insensitively.

Source§

impl TabularDatabase

Source

pub fn dax_expressions(&self) -> Vec<DaxExpressionRef<'_>>

Every DAX expression in the model, with its owner and home-table context.

Order follows model order (tables, then each table’s measures, columns, partitions, refresh-policy change detection, table-level expressions, calculation items and their group’s selection expressions, then roles, then functions), so the result is deterministic for a given model and diffable across runs.

Owners borrow their names, so this allocates only the returned Vec.

Source

pub fn m_expressions(&self) -> Vec<MExpressionRef<'_>>

Every M expression: M partitions, a refresh policy’s expressions, and shared model expressions.

Query and Other partition sources are not M and are excluded. The policy’s sourceExpression is M by definition; its change-detection expression is handed to both lexers — the M side resolves the tables and shared expressions it reads (polling by shared-query name is the documented custom pattern), while the DAX side (TabularDatabase::dax_expressions) resolves its measure references.

Trait Implementations§

Source§

impl Clone for TabularDatabase

Source§

fn clone(&self) -> TabularDatabase

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 TabularDatabase

Source§

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

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

impl Default for TabularDatabase

Source§

fn default() -> TabularDatabase

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

impl Eq for TabularDatabase

Source§

impl PartialEq for TabularDatabase

Source§

fn eq(&self, other: &TabularDatabase) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TabularDatabase

Auto Trait Implementations§

Blanket Implementations§

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<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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> 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.