Struct ormlite_attr::ColumnMetadata
source · pub struct ColumnMetadata {
pub column_name: String,
pub column_type: Type,
pub marked_primary_key: bool,
pub has_database_default: bool,
pub identifier: Ident,
pub many_to_one_key: Option<Ident>,
pub many_to_many_table: Option<Path>,
pub one_to_many_foreign_key: Option<Path>,
}Expand description
All the metadata we can capture about a column
Fields§
§column_name: StringName of the column in the database
column_type: Type§marked_primary_key: boolOnly says whether the primary key is marked (with an attribute). Use table_metadata.primary_key to definitively know the primary key.
has_database_default: bool§identifier: IdentIdentifier used in Rust to refer to the column
many_to_one_key: Option<Ident>§many_to_many_table: Option<Path>§one_to_many_foreign_key: Option<Path>Implementations§
source§impl ColumnMetadata
impl ColumnMetadata
pub fn builder() -> ColumnMetadataBuilder
pub fn is_join(&self) -> bool
sourcepub fn joined_struct_name(&self) -> Option<String>
pub fn joined_struct_name(&self) -> Option<String>
We expect this to only return a Model of some kind.
sourcepub fn joined_path(&self) -> Option<&Path>
pub fn joined_path(&self) -> Option<&Path>
Whatever is inside the Join. We’re expecting a Model or a Vec<Model>.
Trait Implementations§
source§impl Clone for ColumnMetadata
impl Clone for ColumnMetadata
source§fn clone(&self) -> ColumnMetadata
fn clone(&self) -> ColumnMetadata
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more