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_column_name: Option<String>,
pub many_to_many_table: Option<String>,
pub one_to_many_foreign_key: Option<ForeignKey>,
pub skip: bool,
pub experimental_encode_as_json: bool,
pub rust_default: Option<String>,
}
Expand description
All the metadata we can capture about a column
Fields§
§column_name: String
Name of the column in the database
column_type: TType
§marked_primary_key: bool
Only 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: Ident
Identifier used in Rust to refer to the column
many_to_one_column_name: Option<String>
§many_to_many_table: Option<String>
§one_to_many_foreign_key: Option<ForeignKey>
§skip: bool
§experimental_encode_as_json: bool
§rust_default: Option<String>
Implementations§
Source§impl ColumnMetadata
impl ColumnMetadata
pub fn is_default(&self) -> bool
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 duplicate 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 moreSource§impl Debug for ColumnMetadata
impl Debug for ColumnMetadata
Source§impl Default for ColumnMetadata
impl Default for ColumnMetadata
Auto Trait Implementations§
impl Freeze for ColumnMetadata
impl RefUnwindSafe for ColumnMetadata
impl Send for ColumnMetadata
impl Sync for ColumnMetadata
impl Unpin for ColumnMetadata
impl UnwindSafe for ColumnMetadata
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