pub struct TableMetadata {
pub table_name: String,
pub struct_name: Ident,
pub columns: Vec<ColumnMetadata>,
pub databases: Vec<String>,
pub pkey: Option<String>,
}
Expand description
Metadata used for IntoArguments, TableMeta, and (subset of) Model
Fields§
§table_name: String
§struct_name: Ident
§columns: Vec<ColumnMetadata>
§databases: Vec<String>
§pkey: Option<String>
If you’re using this, consider whether you should be using a ModelMetadata and its pkey, which is not optional, instead.
Implementations§
Source§impl TableMetadata
impl TableMetadata
pub fn new(name: &str, columns: Vec<ColumnMetadata>) -> Self
pub fn builder() -> TableMetadataBuilder
pub fn from_derive(ast: &DeriveInput) -> Result<TableMetadata, SyndecodeError>
pub fn all_fields(&self) -> impl Iterator<Item = &Ident> + '_
pub fn database_columns(&self) -> impl Iterator<Item = &ColumnMetadata> + '_
pub fn many_to_one_joins(&self) -> impl Iterator<Item = &ColumnMetadata> + '_
Trait Implementations§
Source§impl Clone for TableMetadata
impl Clone for TableMetadata
Source§fn clone(&self) -> TableMetadata
fn clone(&self) -> TableMetadata
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 moreAuto Trait Implementations§
impl Freeze for TableMetadata
impl RefUnwindSafe for TableMetadata
impl Send for TableMetadata
impl Sync for TableMetadata
impl Unpin for TableMetadata
impl UnwindSafe for TableMetadata
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