Skip to main content

TableDef

Struct TableDef 

Source
pub struct TableDef { /* private fields */ }

Implementations§

Source§

impl TableDef

Source

pub fn new( name: impl Into<String>, primary_key: impl Into<String>, columns: Vec<String>, ) -> Self

Source

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

Source

pub fn with_relationships(self, relationships: Vec<RelationshipDef>) -> Self

Source

pub fn with_schema(self, schema: impl Into<String>) -> Self

Source

pub fn with_comment(self, comment: impl Into<String>) -> Self

Source

pub fn with_tablespace(self, tablespace: impl Into<String>) -> Self

Source

pub fn with_mysql_engine(self, engine: impl Into<String>) -> Self

Source

pub fn with_mysql_charset(self, charset: impl Into<String>) -> Self

Source

pub fn with_mysql_collation(self, collation: impl Into<String>) -> Self

Source

pub fn with_mysql_row_format(self, row_format: impl Into<String>) -> Self

Source

pub fn with_mysql_key_block_size(self, key_block_size: u32) -> Self

Source

pub fn with_mysql_pack_keys(self, pack_keys: bool) -> Self

Source

pub fn with_mysql_checksum(self, checksum: bool) -> Self

Source

pub fn with_mysql_delay_key_write(self, delay_key_write: bool) -> Self

Source

pub fn with_mysql_stats_persistent(self, stats_persistent: bool) -> Self

Source

pub fn with_mysql_stats_auto_recalc(self, stats_auto_recalc: bool) -> Self

Source

pub fn with_mysql_stats_sample_pages(self, stats_sample_pages: u32) -> Self

Source

pub fn with_mysql_avg_row_length(self, avg_row_length: u32) -> Self

Source

pub fn with_mysql_max_rows(self, max_rows: u32) -> Self

Source

pub fn with_mysql_min_rows(self, min_rows: u32) -> Self

Source

pub fn with_mysql_insert_method(self, insert_method: impl Into<String>) -> Self

Source

pub fn with_mysql_data_directory( self, data_directory: impl Into<String>, ) -> Self

Source

pub fn with_mysql_index_directory( self, index_directory: impl Into<String>, ) -> Self

Source

pub fn with_mysql_connection(self, connection: impl Into<String>) -> Self

Source

pub fn with_mysql_union(self, tables: Vec<String>) -> Self

Source

pub fn with_mysql_partition_by(self, partition_by: impl Into<String>) -> Self

Source

pub fn with_mysql_partitions(self, partitions: u32) -> Self

Source

pub fn with_mysql_subpartition_by( self, subpartition_by: impl Into<String>, ) -> Self

Source

pub fn with_mysql_subpartitions(self, subpartitions: u32) -> Self

Source

pub fn with_mysql_auto_increment(self, auto_increment: u32) -> Self

Source

pub fn with_mysql_options(self, options: MysqlTableOptions) -> Self

Source

pub fn with_postgres_inherits(self, parents: Vec<String>) -> Self

Source

pub fn with_postgres_with(self, parameters: Vec<(String, String)>) -> Self

Source

pub fn with_postgres_using(self, access_method: impl Into<String>) -> Self

Source

pub fn with_postgres_using_option(self, access_method: Option<String>) -> Self

Source

pub fn postgres_unlogged(self) -> Self

Source

pub fn with_postgres_unlogged(self, unlogged: bool) -> Self

Source

pub fn sqlite_strict(self) -> Self

Source

pub fn with_sqlite_strict(self, strict: bool) -> Self

Source

pub fn sqlite_without_rowid(self) -> Self

Source

pub fn with_sqlite_without_rowid(self, without_rowid: bool) -> Self

Source

pub fn with_oracle_compress(self) -> Self

Source

pub fn with_oracle_compress_level(self, level: u32) -> Self

Source

pub fn with_oracle_compress_option( self, compress: Option<OracleTableCompression>, ) -> Self

Source

pub fn with_mssql_primary_key_nonclustered(self, nonclustered: bool) -> Self

Source

pub fn with_postgres_partition_by(self, partition_by: impl Into<String>) -> Self

Source

pub fn with_postgres_partition_by_option( self, partition_by: Option<String>, ) -> Self

Source

pub fn with_postgres_partition_of(self, parent: impl Into<String>) -> Self

Source

pub fn with_postgres_partition_of_option(self, parent: Option<String>) -> Self

Source

pub fn with_postgres_partition_for(self, bound: impl Into<String>) -> Self

Source

pub fn with_postgres_partition_for_option(self, bound: Option<String>) -> Self

Source

pub fn with_check_constraints( self, check_constraints: Vec<CheckConstraintDef>, ) -> Self

Source

pub fn with_foreign_keys(self, foreign_keys: Vec<ForeignKeyDef>) -> Self

Source

pub fn with_exclusion_constraints( self, exclusion_constraints: Vec<ExclusionConstraintDef>, ) -> Self

Source

pub fn set_id(&mut self, id: TableId)

Source

pub fn id(&self) -> Option<TableId>

Source

pub fn model_key(&self) -> &str

Source

pub fn name(&self) -> &str

Source

pub fn primary_key(&self) -> &str

Source

pub fn columns(&self) -> &[ColumnDef]

Source

pub fn column_names(&self) -> impl Iterator<Item = &str>

Source

pub fn relationships(&self) -> &[RelationshipDef]

Source

pub fn indexes(&self) -> &[IndexDef]

Source

pub fn unique_constraints(&self) -> &[UniqueConstraintDef]

Source

pub fn check_constraints(&self) -> &[CheckConstraintDef]

Source

pub fn foreign_keys(&self) -> &[ForeignKeyDef]

Source

pub fn exclusion_constraints(&self) -> &[ExclusionConstraintDef]

Source

pub fn schema(&self) -> Option<&str>

Source

pub fn comment(&self) -> Option<&str>

Source

pub fn tablespace(&self) -> Option<&str>

Source

pub fn mysql_engine(&self) -> Option<&str>

Source

pub fn mysql_charset(&self) -> Option<&str>

Source

pub fn mysql_collation(&self) -> Option<&str>

Source

pub fn mysql_row_format(&self) -> Option<&str>

Source

pub fn mysql_key_block_size(&self) -> Option<u32>

Source

pub fn mysql_pack_keys(&self) -> Option<bool>

Source

pub fn mysql_checksum(&self) -> Option<bool>

Source

pub fn mysql_delay_key_write(&self) -> Option<bool>

Source

pub fn mysql_stats_persistent(&self) -> Option<bool>

Source

pub fn mysql_stats_auto_recalc(&self) -> Option<bool>

Source

pub fn mysql_stats_sample_pages(&self) -> Option<u32>

Source

pub fn mysql_avg_row_length(&self) -> Option<u32>

Source

pub fn mysql_max_rows(&self) -> Option<u32>

Source

pub fn mysql_min_rows(&self) -> Option<u32>

Source

pub fn mysql_insert_method(&self) -> Option<&str>

Source

pub fn mysql_data_directory(&self) -> Option<&str>

Source

pub fn mysql_index_directory(&self) -> Option<&str>

Source

pub fn mysql_connection(&self) -> Option<&str>

Source

pub fn mysql_union(&self) -> &[String]

Source

pub fn mysql_partition_by(&self) -> Option<&str>

Source

pub fn mysql_partitions(&self) -> Option<u32>

Source

pub fn mysql_subpartition_by(&self) -> Option<&str>

Source

pub fn mysql_subpartitions(&self) -> Option<u32>

Source

pub fn mysql_auto_increment(&self) -> Option<u32>

Source

pub fn postgres_inherits(&self) -> &[String]

Source

pub fn postgres_with(&self) -> &[(String, String)]

Source

pub fn postgres_using(&self) -> Option<&str>

Source

pub fn is_postgres_unlogged(&self) -> bool

Source

pub fn postgres_partition_by(&self) -> Option<&str>

Source

pub fn postgres_partition_of(&self) -> Option<&str>

Source

pub fn postgres_partition_for(&self) -> Option<&str>

Source

pub fn is_sqlite_strict(&self) -> bool

Source

pub fn is_sqlite_without_rowid(&self) -> bool

Source

pub fn oracle_compress(&self) -> Option<&OracleTableCompression>

Source

pub fn is_mssql_primary_key_nonclustered(&self) -> bool

Source

pub fn qualified_name(&self) -> QualifiedName

Trait Implementations§

Source§

impl Clone for TableDef

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TableDef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TableDef

Source§

impl PartialEq for TableDef

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TableDef

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.