Struct ormlite_attr::ColumnMetadata
source · pub struct ColumnMetadata {
pub column_name: String,
pub column_type: TType,
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<String>,
pub one_to_many_foreign_key: Option<ForeignKey>,
pub skip: bool,
pub experimental_encode_as_json: bool,
}Expand description
All the metadata we can capture about a column
Fields§
§column_name: StringName of the column in the database
column_type: TType§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<String>§one_to_many_foreign_key: Option<ForeignKey>§skip: bool§experimental_encode_as_json: boolImplementations§
source§impl ColumnMetadata
impl ColumnMetadata
pub fn new(name: &str, ty: &str) -> Self
pub fn new_join(name: &str, join_model: &str) -> Self
pub fn builder() -> ColumnMetadataBuilder
pub fn is_join(&self) -> bool
pub fn is_join_many(&self) -> bool
pub fn is_json(&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.
pub fn joined_model(&self) -> TokenStream
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