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.
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.
Sourcepub fn table(&self, h: TableHandle) -> Option<&Table>
pub fn table(&self, h: TableHandle) -> Option<&Table>
The table a handle points at, or None if the handle is stale.
Sourcepub fn column(&self, h: ColumnHandle) -> Option<&Column>
pub fn column(&self, h: ColumnHandle) -> Option<&Column>
The column a handle points at, or None if either index is out of range.
Sourcepub fn measure(&self, h: MeasureHandle) -> Option<&Measure>
pub fn measure(&self, h: MeasureHandle) -> Option<&Measure>
The measure a handle points at, or None if either index is out of range.
Sourcepub fn hierarchy(&self, h: HierarchyHandle) -> Option<&Hierarchy>
pub fn hierarchy(&self, h: HierarchyHandle) -> Option<&Hierarchy>
The hierarchy a handle points at, or None if either index is out of range.
The shared M expression a handle points at, or None if the handle is stale.
Sourcepub fn function(&self, h: FunctionHandle) -> Option<&Function>
pub fn function(&self, h: FunctionHandle) -> Option<&Function>
The user-defined function a handle points at, or None if the handle is stale.
Source§impl TabularDatabase
impl TabularDatabase
Sourcepub fn dax_expressions(&self) -> Vec<DaxExpressionRef<'_>>
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, 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.
Sourcepub fn m_expressions(&self) -> Vec<MExpressionRef<'_>>
pub fn m_expressions(&self) -> Vec<MExpressionRef<'_>>
Every M expression: M partitions plus shared model expressions.
Query and Other partition sources are not M and are excluded.
Trait Implementations§
Source§impl Clone for TabularDatabase
impl Clone for TabularDatabase
Source§fn clone(&self) -> TabularDatabase
fn clone(&self) -> TabularDatabase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TabularDatabase
impl Debug for TabularDatabase
Source§impl Default for TabularDatabase
impl Default for TabularDatabase
Source§fn default() -> TabularDatabase
fn default() -> TabularDatabase
impl Eq for TabularDatabase
Source§impl PartialEq for TabularDatabase
impl PartialEq for TabularDatabase
impl StructuralPartialEq for TabularDatabase
Auto Trait Implementations§
impl Freeze for TabularDatabase
impl RefUnwindSafe for TabularDatabase
impl Send for TabularDatabase
impl Sync for TabularDatabase
impl Unpin for TabularDatabase
impl UnsafeUnpin for TabularDatabase
impl UnwindSafe for TabularDatabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.