pub struct TableDef { /* private fields */ }Implementations§
Source§impl TableDef
impl TableDef
pub fn new( name: impl Into<String>, primary_key: impl Into<String>, columns: Vec<String>, ) -> Self
pub fn from_parts( name: impl Into<String>, model_key: impl Into<String>, primary_key: impl Into<String>, columns: Vec<ColumnDef>, indexes: Vec<IndexDef>, unique_constraints: Vec<UniqueConstraintDef>, relationships: Vec<RelationshipDef>, ) -> Self
pub fn with_relationships(self, relationships: Vec<RelationshipDef>) -> Self
pub fn with_schema(self, schema: impl Into<String>) -> Self
pub fn with_comment(self, comment: impl Into<String>) -> Self
pub fn with_tablespace(self, tablespace: impl Into<String>) -> Self
pub fn with_mysql_engine(self, engine: impl Into<String>) -> Self
pub fn with_mysql_charset(self, charset: impl Into<String>) -> Self
pub fn with_mysql_collation(self, collation: impl Into<String>) -> Self
pub fn with_mysql_row_format(self, row_format: impl Into<String>) -> Self
pub fn with_mysql_key_block_size(self, key_block_size: u32) -> Self
pub fn with_mysql_pack_keys(self, pack_keys: bool) -> Self
pub fn with_mysql_checksum(self, checksum: bool) -> Self
pub fn with_mysql_delay_key_write(self, delay_key_write: bool) -> Self
pub fn with_mysql_stats_persistent(self, stats_persistent: bool) -> Self
pub fn with_mysql_stats_auto_recalc(self, stats_auto_recalc: bool) -> Self
pub fn with_mysql_stats_sample_pages(self, stats_sample_pages: u32) -> Self
pub fn with_mysql_avg_row_length(self, avg_row_length: u32) -> Self
pub fn with_mysql_max_rows(self, max_rows: u32) -> Self
pub fn with_mysql_min_rows(self, min_rows: u32) -> Self
pub fn with_mysql_insert_method(self, insert_method: impl Into<String>) -> Self
pub fn with_mysql_data_directory( self, data_directory: impl Into<String>, ) -> Self
pub fn with_mysql_index_directory( self, index_directory: impl Into<String>, ) -> Self
pub fn with_mysql_connection(self, connection: impl Into<String>) -> Self
pub fn with_mysql_union(self, tables: Vec<String>) -> Self
pub fn with_mysql_partition_by(self, partition_by: impl Into<String>) -> Self
pub fn with_mysql_partitions(self, partitions: u32) -> Self
pub fn with_mysql_subpartition_by( self, subpartition_by: impl Into<String>, ) -> Self
pub fn with_mysql_subpartitions(self, subpartitions: u32) -> Self
pub fn with_mysql_auto_increment(self, auto_increment: u32) -> Self
pub fn with_mysql_options(self, options: MysqlTableOptions) -> Self
pub fn with_postgres_inherits(self, parents: Vec<String>) -> Self
pub fn with_postgres_with(self, parameters: Vec<(String, String)>) -> Self
pub fn with_postgres_using(self, access_method: impl Into<String>) -> Self
pub fn with_postgres_using_option(self, access_method: Option<String>) -> Self
pub fn postgres_unlogged(self) -> Self
pub fn with_postgres_unlogged(self, unlogged: bool) -> Self
pub fn sqlite_strict(self) -> Self
pub fn with_sqlite_strict(self, strict: bool) -> Self
pub fn sqlite_without_rowid(self) -> Self
pub fn with_sqlite_without_rowid(self, without_rowid: bool) -> Self
pub fn with_oracle_compress(self) -> Self
pub fn with_oracle_compress_level(self, level: u32) -> Self
pub fn with_oracle_compress_option( self, compress: Option<OracleTableCompression>, ) -> Self
pub fn with_mssql_primary_key_nonclustered(self, nonclustered: bool) -> Self
pub fn with_postgres_partition_by(self, partition_by: impl Into<String>) -> Self
pub fn with_postgres_partition_by_option( self, partition_by: Option<String>, ) -> Self
pub fn with_postgres_partition_of(self, parent: impl Into<String>) -> Self
pub fn with_postgres_partition_of_option(self, parent: Option<String>) -> Self
pub fn with_postgres_partition_for(self, bound: impl Into<String>) -> Self
pub fn with_postgres_partition_for_option(self, bound: Option<String>) -> Self
pub fn with_check_constraints( self, check_constraints: Vec<CheckConstraintDef>, ) -> Self
pub fn with_foreign_keys(self, foreign_keys: Vec<ForeignKeyDef>) -> Self
pub fn with_exclusion_constraints( self, exclusion_constraints: Vec<ExclusionConstraintDef>, ) -> Self
pub fn set_id(&mut self, id: TableId)
pub fn id(&self) -> Option<TableId>
pub fn model_key(&self) -> &str
pub fn name(&self) -> &str
pub fn primary_key(&self) -> &str
pub fn columns(&self) -> &[ColumnDef]
pub fn column_names(&self) -> impl Iterator<Item = &str>
pub fn relationships(&self) -> &[RelationshipDef]
pub fn indexes(&self) -> &[IndexDef]
pub fn unique_constraints(&self) -> &[UniqueConstraintDef]
pub fn check_constraints(&self) -> &[CheckConstraintDef]
pub fn foreign_keys(&self) -> &[ForeignKeyDef]
pub fn exclusion_constraints(&self) -> &[ExclusionConstraintDef]
pub fn schema(&self) -> Option<&str>
pub fn comment(&self) -> Option<&str>
pub fn tablespace(&self) -> Option<&str>
pub fn mysql_engine(&self) -> Option<&str>
pub fn mysql_charset(&self) -> Option<&str>
pub fn mysql_collation(&self) -> Option<&str>
pub fn mysql_row_format(&self) -> Option<&str>
pub fn mysql_key_block_size(&self) -> Option<u32>
pub fn mysql_pack_keys(&self) -> Option<bool>
pub fn mysql_checksum(&self) -> Option<bool>
pub fn mysql_delay_key_write(&self) -> Option<bool>
pub fn mysql_stats_persistent(&self) -> Option<bool>
pub fn mysql_stats_auto_recalc(&self) -> Option<bool>
pub fn mysql_stats_sample_pages(&self) -> Option<u32>
pub fn mysql_avg_row_length(&self) -> Option<u32>
pub fn mysql_max_rows(&self) -> Option<u32>
pub fn mysql_min_rows(&self) -> Option<u32>
pub fn mysql_insert_method(&self) -> Option<&str>
pub fn mysql_data_directory(&self) -> Option<&str>
pub fn mysql_index_directory(&self) -> Option<&str>
pub fn mysql_connection(&self) -> Option<&str>
pub fn mysql_union(&self) -> &[String]
pub fn mysql_partition_by(&self) -> Option<&str>
pub fn mysql_partitions(&self) -> Option<u32>
pub fn mysql_subpartition_by(&self) -> Option<&str>
pub fn mysql_subpartitions(&self) -> Option<u32>
pub fn mysql_auto_increment(&self) -> Option<u32>
pub fn postgres_inherits(&self) -> &[String]
pub fn postgres_with(&self) -> &[(String, String)]
pub fn postgres_using(&self) -> Option<&str>
pub fn is_postgres_unlogged(&self) -> bool
pub fn postgres_partition_by(&self) -> Option<&str>
pub fn postgres_partition_of(&self) -> Option<&str>
pub fn postgres_partition_for(&self) -> Option<&str>
pub fn is_sqlite_strict(&self) -> bool
pub fn is_sqlite_without_rowid(&self) -> bool
pub fn oracle_compress(&self) -> Option<&OracleTableCompression>
pub fn is_mssql_primary_key_nonclustered(&self) -> bool
pub fn qualified_name(&self) -> QualifiedName
Trait Implementations§
impl Eq for TableDef
impl StructuralPartialEq for TableDef
Auto Trait Implementations§
impl Freeze for TableDef
impl RefUnwindSafe for TableDef
impl Send for TableDef
impl Sync for TableDef
impl Unpin for TableDef
impl UnsafeUnpin for TableDef
impl UnwindSafe for TableDef
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