pub trait TableBuilder:
IndexBuilder
+ ForeignKeyBuilder
+ QuotedBuilder
+ TableRefBuilder
+ QueryBuilder {
Show 19 methods
// Required methods
fn prepare_column_def(
&self,
column_def: &ColumnDef,
sql: &mut dyn SqlWriter,
);
fn prepare_column_type(
&self,
column_type: &ColumnType,
sql: &mut dyn SqlWriter,
);
fn column_spec_auto_increment_keyword(&self) -> &str;
fn prepare_table_alter_statement(
&self,
alter: &TableAlterStatement,
sql: &mut dyn SqlWriter,
);
fn prepare_table_rename_statement(
&self,
rename: &TableRenameStatement,
sql: &mut dyn SqlWriter,
);
// Provided methods
fn prepare_table_create_statement(
&self,
create: &TableCreateStatement,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_table_ref_table_stmt(
&self,
table_ref: &TableRef,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_column_def_internal(
&self,
_is_alter_column: bool,
column_def: &ColumnDef,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_column_spec(
&self,
column_spec: &ColumnSpec,
sql: &mut dyn SqlWriter,
) { ... }
fn column_comment(&self, _comment: &str, _sql: &mut dyn SqlWriter) { ... }
fn prepare_table_opt(
&self,
create: &TableCreateStatement,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_table_opt_def(
&self,
create: &TableCreateStatement,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_table_partition(
&self,
_table_partition: &TablePartition,
_sql: &mut dyn SqlWriter,
) { ... }
fn prepare_table_drop_statement(
&self,
drop: &TableDropStatement,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_table_drop_opt(
&self,
drop_opt: &TableDropOpt,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_table_truncate_statement(
&self,
truncate: &TableTruncateStatement,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_check_constraint(
&self,
check: &SimpleExpr,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_generated_column(
&self,
gen: &SimpleExpr,
stored: bool,
sql: &mut dyn SqlWriter,
) { ... }
fn prepare_create_table_if_not_exists(
&self,
create: &TableCreateStatement,
sql: &mut dyn SqlWriter,
) { ... }
}
Required Methods§
sourcefn prepare_column_def(&self, column_def: &ColumnDef, sql: &mut dyn SqlWriter)
fn prepare_column_def(&self, column_def: &ColumnDef, sql: &mut dyn SqlWriter)
Translate ColumnDef
into SQL statement.
sourcefn prepare_column_type(&self, column_type: &ColumnType, sql: &mut dyn SqlWriter)
fn prepare_column_type(&self, column_type: &ColumnType, sql: &mut dyn SqlWriter)
Translate ColumnType
into SQL statement.
sourcefn column_spec_auto_increment_keyword(&self) -> &str
fn column_spec_auto_increment_keyword(&self) -> &str
The keyword for setting a column to be auto increment.
sourcefn prepare_table_alter_statement(
&self,
alter: &TableAlterStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_table_alter_statement( &self, alter: &TableAlterStatement, sql: &mut dyn SqlWriter, )
Translate TableAlterStatement
into SQL statement.
sourcefn prepare_table_rename_statement(
&self,
rename: &TableRenameStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_table_rename_statement( &self, rename: &TableRenameStatement, sql: &mut dyn SqlWriter, )
Translate TableRenameStatement
into SQL statement.
Provided Methods§
sourcefn prepare_table_create_statement(
&self,
create: &TableCreateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_table_create_statement( &self, create: &TableCreateStatement, sql: &mut dyn SqlWriter, )
Translate TableCreateStatement
into SQL statement.
sourcefn prepare_table_ref_table_stmt(
&self,
table_ref: &TableRef,
sql: &mut dyn SqlWriter,
)
fn prepare_table_ref_table_stmt( &self, table_ref: &TableRef, sql: &mut dyn SqlWriter, )
Translate TableRef
into SQL statement.
sourcefn prepare_column_def_internal(
&self,
_is_alter_column: bool,
column_def: &ColumnDef,
sql: &mut dyn SqlWriter,
)
fn prepare_column_def_internal( &self, _is_alter_column: bool, column_def: &ColumnDef, sql: &mut dyn SqlWriter, )
Translate ColumnDef
into SQL statement.
sourcefn prepare_column_spec(&self, column_spec: &ColumnSpec, sql: &mut dyn SqlWriter)
fn prepare_column_spec(&self, column_spec: &ColumnSpec, sql: &mut dyn SqlWriter)
Translate ColumnSpec
into SQL statement.
sourcefn column_comment(&self, _comment: &str, _sql: &mut dyn SqlWriter)
fn column_comment(&self, _comment: &str, _sql: &mut dyn SqlWriter)
column comment
sourcefn prepare_table_opt(
&self,
create: &TableCreateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_table_opt( &self, create: &TableCreateStatement, sql: &mut dyn SqlWriter, )
Translate TableOpt
into SQL statement.
sourcefn prepare_table_opt_def(
&self,
create: &TableCreateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_table_opt_def( &self, create: &TableCreateStatement, sql: &mut dyn SqlWriter, )
Default function
sourcefn prepare_table_partition(
&self,
_table_partition: &TablePartition,
_sql: &mut dyn SqlWriter,
)
fn prepare_table_partition( &self, _table_partition: &TablePartition, _sql: &mut dyn SqlWriter, )
Translate TablePartition
into SQL statement.
sourcefn prepare_table_drop_statement(
&self,
drop: &TableDropStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_table_drop_statement( &self, drop: &TableDropStatement, sql: &mut dyn SqlWriter, )
Translate TableDropStatement
into SQL statement.
sourcefn prepare_table_drop_opt(
&self,
drop_opt: &TableDropOpt,
sql: &mut dyn SqlWriter,
)
fn prepare_table_drop_opt( &self, drop_opt: &TableDropOpt, sql: &mut dyn SqlWriter, )
Translate TableDropOpt
into SQL statement.
sourcefn prepare_table_truncate_statement(
&self,
truncate: &TableTruncateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_table_truncate_statement( &self, truncate: &TableTruncateStatement, sql: &mut dyn SqlWriter, )
Translate TableTruncateStatement
into SQL statement.
sourcefn prepare_check_constraint(&self, check: &SimpleExpr, sql: &mut dyn SqlWriter)
fn prepare_check_constraint(&self, check: &SimpleExpr, sql: &mut dyn SqlWriter)
Translate the check constraint into SQL statement
sourcefn prepare_generated_column(
&self,
gen: &SimpleExpr,
stored: bool,
sql: &mut dyn SqlWriter,
)
fn prepare_generated_column( &self, gen: &SimpleExpr, stored: bool, sql: &mut dyn SqlWriter, )
Translate the generated column into SQL statement
sourcefn prepare_create_table_if_not_exists(
&self,
create: &TableCreateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_create_table_if_not_exists( &self, create: &TableCreateStatement, sql: &mut dyn SqlWriter, )
Translate IF NOT EXISTS expression in TableCreateStatement
.
Implementors§
impl TableBuilder for MysqlQueryBuilder
backend-mysql
only.impl TableBuilder for PostgresQueryBuilder
backend-postgres
only.impl TableBuilder for SqliteQueryBuilder
backend-sqlite
only.