pub struct ModelDefinition {
pub name: String,
pub description: Option<String>,
pub columns: Vec<ColumnDefinition>,
pub config: Option<ModelConfig>,
pub tags: Vec<String>,
pub tests: Vec<TestDefinition>,
pub versions: Vec<VersionSpec>,
pub latest_version: Option<Value>,
}Fields§
§name: String§description: Option<String>§columns: Vec<ColumnDefinition>§config: Option<ModelConfig>§tests: Vec<TestDefinition>Model-level tests (not attached to a specific column)
versions: Vec<VersionSpec>Versioned model definitions (dbt v1.5+)
latest_version: Option<Value>Latest version used when ref(‘name’) is called without version= kwarg
Implementations§
Source§impl ModelDefinition
impl ModelDefinition
Sourcepub fn resolved_latest_version_str(&self) -> Option<String>
pub fn resolved_latest_version_str(&self) -> Option<String>
Return the version string used for latest_version, or derive it from
the versions list when latest_version is unset.
Inference mirrors dbt-core: if all versions parse as numbers, use the largest; otherwise fall back to the lexicographically greatest string.
Trait Implementations§
Source§impl Clone for ModelDefinition
impl Clone for ModelDefinition
Source§fn clone(&self) -> ModelDefinition
fn clone(&self) -> ModelDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelDefinition
impl Debug for ModelDefinition
Source§impl<'de> Deserialize<'de> for ModelDefinition
impl<'de> Deserialize<'de> for ModelDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModelDefinition
impl RefUnwindSafe for ModelDefinition
impl Send for ModelDefinition
impl Sync for ModelDefinition
impl Unpin for ModelDefinition
impl UnsafeUnpin for ModelDefinition
impl UnwindSafe for ModelDefinition
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more