Struct MysqlQueryBuilder
pub struct MysqlQueryBuilder;
Expand description
Mysql query builder.
Trait Implementations§
§impl Debug for MysqlQueryBuilder
impl Debug for MysqlQueryBuilder
§impl Default for MysqlQueryBuilder
impl Default for MysqlQueryBuilder
§fn default() -> MysqlQueryBuilder
fn default() -> MysqlQueryBuilder
Returns the “default value” for a type. Read more
§impl EscapeBuilder for MysqlQueryBuilder
impl EscapeBuilder for MysqlQueryBuilder
§fn escape_string(&self, string: &str) -> String
fn escape_string(&self, string: &str) -> String
Escape a SQL string literal
§fn unescape_string(&self, string: &str) -> String
fn unescape_string(&self, string: &str) -> String
Unescape a SQL string literal
§impl ForeignKeyBuilder for MysqlQueryBuilder
impl ForeignKeyBuilder for MysqlQueryBuilder
§fn prepare_table_ref_fk_stmt(
&self,
table_ref: &TableRef,
sql: &mut dyn SqlWriter,
)
fn prepare_table_ref_fk_stmt( &self, table_ref: &TableRef, sql: &mut dyn SqlWriter, )
Translate
TableRef
into SQL statement.§fn prepare_foreign_key_create_statement(
&self,
create: &ForeignKeyCreateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_foreign_key_create_statement( &self, create: &ForeignKeyCreateStatement, sql: &mut dyn SqlWriter, )
Translate
ForeignKeyCreateStatement
into SQL statement.§fn prepare_foreign_key_drop_statement(
&self,
drop: &ForeignKeyDropStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_foreign_key_drop_statement( &self, drop: &ForeignKeyDropStatement, sql: &mut dyn SqlWriter, )
Translate
ForeignKeyDropStatement
into SQL statement.§fn prepare_foreign_key_action(
&self,
foreign_key_action: &ForeignKeyAction,
sql: &mut dyn SqlWriter,
)
fn prepare_foreign_key_action( &self, foreign_key_action: &ForeignKeyAction, sql: &mut dyn SqlWriter, )
Translate
ForeignKeyAction
into SQL statement.§impl IndexBuilder for MysqlQueryBuilder
impl IndexBuilder for MysqlQueryBuilder
§fn prepare_table_index_expression(
&self,
create: &IndexCreateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_table_index_expression( &self, create: &IndexCreateStatement, sql: &mut dyn SqlWriter, )
Translate
IndexCreateStatement
into SQL expression.
This is the default implementation for PostgresQueryBuilder
and SqliteQueryBuilder
.
MysqlQueryBuilder
overrides this default implementation.§fn prepare_index_create_statement(
&self,
create: &IndexCreateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_index_create_statement( &self, create: &IndexCreateStatement, sql: &mut dyn SqlWriter, )
Translate
IndexCreateStatement
into SQL statement.§fn prepare_table_ref_index_stmt(
&self,
table_ref: &TableRef,
sql: &mut dyn SqlWriter,
)
fn prepare_table_ref_index_stmt( &self, table_ref: &TableRef, sql: &mut dyn SqlWriter, )
Translate
TableRef
into SQL statement.§fn prepare_index_drop_statement(
&self,
drop: &IndexDropStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_index_drop_statement( &self, drop: &IndexDropStatement, sql: &mut dyn SqlWriter, )
Translate
IndexDropStatement
into SQL statement.§impl OperLeftAssocDecider for MysqlQueryBuilder
impl OperLeftAssocDecider for MysqlQueryBuilder
fn well_known_left_associative(&self, op: &BinOper) -> bool
§impl PrecedenceDecider for MysqlQueryBuilder
impl PrecedenceDecider for MysqlQueryBuilder
fn inner_expr_well_known_greater_precedence( &self, inner: &SimpleExpr, outer_oper: &Oper, ) -> bool
§impl QueryBuilder for MysqlQueryBuilder
impl QueryBuilder for MysqlQueryBuilder
§fn values_list_tuple_prefix(&self) -> &str
fn values_list_tuple_prefix(&self) -> &str
Prefix for tuples in VALUES list (e.g. ROW for MySQL)
§fn prepare_select_distinct(
&self,
select_distinct: &SelectDistinct,
sql: &mut dyn SqlWriter,
)
fn prepare_select_distinct( &self, select_distinct: &SelectDistinct, sql: &mut dyn SqlWriter, )
Translate
SelectDistinct
into SQL statement.§fn prepare_index_hints(&self, select: &SelectStatement, sql: &mut dyn SqlWriter)
fn prepare_index_hints(&self, select: &SelectStatement, sql: &mut dyn SqlWriter)
Translate [
IndexHint
] into SQL statement.§fn prepare_query_statement(
&self,
query: &SubQueryStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_query_statement( &self, query: &SubQueryStatement, sql: &mut dyn SqlWriter, )
Translate
QueryStatement
into SQL statement.fn prepare_with_clause_recursive_options( &self, _: &WithClause, _: &mut dyn SqlWriter, )
fn prepare_with_query_clause_materialization( &self, _: &CommonTableExpression, _: &mut dyn SqlWriter, )
fn prepare_update_join( &self, from: &[TableRef], condition: &ConditionHolder, sql: &mut dyn SqlWriter, )
fn prepare_update_from(&self, _: &[TableRef], _: &mut dyn SqlWriter)
fn prepare_update_column( &self, table: &Option<Box<TableRef>>, from: &[TableRef], column: &SeaRc<dyn Iden>, sql: &mut dyn SqlWriter, )
fn prepare_update_condition( &self, from: &[TableRef], condition: &ConditionHolder, sql: &mut dyn SqlWriter, )
§fn prepare_join_type(&self, join_type: &JoinType, sql: &mut dyn SqlWriter)
fn prepare_join_type(&self, join_type: &JoinType, sql: &mut dyn SqlWriter)
Translate
JoinType
into SQL statement.§fn prepare_order_expr(&self, order_expr: &OrderExpr, sql: &mut dyn SqlWriter)
fn prepare_order_expr(&self, order_expr: &OrderExpr, sql: &mut dyn SqlWriter)
Translate
OrderExpr
into SQL statement.§fn prepare_value(&self, value: &Value, sql: &mut dyn SqlWriter)
fn prepare_value(&self, value: &Value, sql: &mut dyn SqlWriter)
Write
Value
into SQL statement as parameter.§fn insert_default_keyword(&self) -> &str
fn insert_default_keyword(&self) -> &str
The keywords for insert default row.
§fn placeholder(&self) -> (&str, bool)
fn placeholder(&self) -> (&str, bool)
The type of placeholder the builder uses for values, and whether it is numbered.
§fn prepare_insert_statement(
&self,
insert: &InsertStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_insert_statement( &self, insert: &InsertStatement, sql: &mut dyn SqlWriter, )
Translate
InsertStatement
into SQL statement.fn prepare_union_statement( &self, union_type: UnionType, select_statement: &SelectStatement, sql: &mut dyn SqlWriter, )
§fn prepare_select_statement(
&self,
select: &SelectStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_select_statement( &self, select: &SelectStatement, sql: &mut dyn SqlWriter, )
Translate
SelectStatement
into SQL statement.fn prepare_select_limit_offset( &self, select: &SelectStatement, sql: &mut dyn SqlWriter, )
§fn prepare_update_statement(
&self,
update: &UpdateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_update_statement( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, )
Translate
UpdateStatement
into SQL statement.§fn prepare_update_order_by(
&self,
update: &UpdateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_update_order_by( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, )
Translate ORDER BY expression in
UpdateStatement
.§fn prepare_update_limit(
&self,
update: &UpdateStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_update_limit( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, )
Translate LIMIT expression in
UpdateStatement
.§fn prepare_delete_statement(
&self,
delete: &DeleteStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_delete_statement( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, )
Translate
DeleteStatement
into SQL statement.§fn prepare_delete_order_by(
&self,
delete: &DeleteStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_delete_order_by( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, )
Translate ORDER BY expression in
DeleteStatement
.§fn prepare_delete_limit(
&self,
delete: &DeleteStatement,
sql: &mut dyn SqlWriter,
)
fn prepare_delete_limit( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, )
Translate LIMIT expression in
DeleteStatement
.§fn prepare_simple_expr(&self, simple_expr: &SimpleExpr, sql: &mut dyn SqlWriter)
fn prepare_simple_expr(&self, simple_expr: &SimpleExpr, sql: &mut dyn SqlWriter)
Translate
SimpleExpr
into SQL statement.fn prepare_simple_expr_common( &self, simple_expr: &SimpleExpr, sql: &mut dyn SqlWriter, )
§fn prepare_case_statement(&self, stmts: &CaseStatement, sql: &mut dyn SqlWriter)
fn prepare_case_statement(&self, stmts: &CaseStatement, sql: &mut dyn SqlWriter)
Translate
CaseStatement
into SQL statement.§fn prepare_table_sample(
&self,
_select: &SelectStatement,
_sql: &mut dyn SqlWriter,
)
fn prepare_table_sample( &self, _select: &SelectStatement, _sql: &mut dyn SqlWriter, )
Translate [
TableSample
] into SQL statement.§fn prepare_select_lock(&self, lock: &LockClause, sql: &mut dyn SqlWriter)
fn prepare_select_lock(&self, lock: &LockClause, sql: &mut dyn SqlWriter)
Translate
LockType
into SQL statement.§fn prepare_select_expr(&self, select_expr: &SelectExpr, sql: &mut dyn SqlWriter)
fn prepare_select_expr(&self, select_expr: &SelectExpr, sql: &mut dyn SqlWriter)
Translate
SelectExpr
into SQL statement.§fn prepare_join_expr(&self, join_expr: &JoinExpr, sql: &mut dyn SqlWriter)
fn prepare_join_expr(&self, join_expr: &JoinExpr, sql: &mut dyn SqlWriter)
Translate
JoinExpr
into SQL statement.fn prepare_join_table_ref(&self, join_expr: &JoinExpr, sql: &mut dyn SqlWriter)
§fn prepare_table_ref(&self, table_ref: &TableRef, sql: &mut dyn SqlWriter)
fn prepare_table_ref(&self, table_ref: &TableRef, sql: &mut dyn SqlWriter)
Translate
TableRef
into SQL statement.fn prepare_column_ref(&self, column_ref: &ColumnRef, sql: &mut dyn SqlWriter)
§fn prepare_un_oper(&self, un_oper: &UnOper, sql: &mut dyn SqlWriter)
fn prepare_un_oper(&self, un_oper: &UnOper, sql: &mut dyn SqlWriter)
Translate
UnOper
into SQL statement.fn prepare_bin_oper_common(&self, bin_oper: &BinOper, sql: &mut dyn SqlWriter)
§fn prepare_bin_oper(&self, bin_oper: &BinOper, sql: &mut dyn SqlWriter)
fn prepare_bin_oper(&self, bin_oper: &BinOper, sql: &mut dyn SqlWriter)
Translate
BinOper
into SQL statement.§fn prepare_sub_query_oper(&self, oper: &SubQueryOper, sql: &mut dyn SqlWriter)
fn prepare_sub_query_oper(&self, oper: &SubQueryOper, sql: &mut dyn SqlWriter)
Translate
SubQueryOper
into SQL statement.§fn prepare_logical_chain_oper(
&self,
log_chain_oper: &LogicalChainOper,
i: usize,
length: usize,
sql: &mut dyn SqlWriter,
)
fn prepare_logical_chain_oper( &self, log_chain_oper: &LogicalChainOper, i: usize, length: usize, sql: &mut dyn SqlWriter, )
Translate
LogicalChainOper
into SQL statement.§fn prepare_function_name_common(
&self,
function: &Function,
sql: &mut dyn SqlWriter,
)
fn prepare_function_name_common( &self, function: &Function, sql: &mut dyn SqlWriter, )
Translate
Function
into SQL statement.fn prepare_function_arguments( &self, func: &FunctionCall, sql: &mut dyn SqlWriter, )
fn prepare_with_query(&self, query: &WithQuery, sql: &mut dyn SqlWriter)
fn prepare_with_clause(&self, with_clause: &WithClause, sql: &mut dyn SqlWriter)
fn prepare_with_clause_common_tables( &self, with_clause: &WithClause, sql: &mut dyn SqlWriter, )
fn prepare_with_query_clause_common_table( &self, cte: &CommonTableExpression, sql: &mut dyn SqlWriter, )
fn prepare_with_clause_start( &self, with_clause: &WithClause, sql: &mut dyn SqlWriter, )
fn prepare_insert(&self, replace: bool, sql: &mut dyn SqlWriter)
fn prepare_function_name(&self, function: &Function, sql: &mut dyn SqlWriter)
fn prepare_join_type_common( &self, join_type: &JoinType, sql: &mut dyn SqlWriter, )
§fn prepare_join_on(&self, join_on: &JoinOn, sql: &mut dyn SqlWriter)
fn prepare_join_on(&self, join_on: &JoinOn, sql: &mut dyn SqlWriter)
Translate
JoinOn
into SQL statement.§fn prepare_order(&self, order_expr: &OrderExpr, sql: &mut dyn SqlWriter)
fn prepare_order(&self, order_expr: &OrderExpr, sql: &mut dyn SqlWriter)
Translate
Order
into SQL statement.§fn prepare_field_order(
&self,
order_expr: &OrderExpr,
values: &Values,
sql: &mut dyn SqlWriter,
)
fn prepare_field_order( &self, order_expr: &OrderExpr, values: &Values, sql: &mut dyn SqlWriter, )
Translate
Order::Field
into SQL statement§fn prepare_constant(&self, value: &Value, sql: &mut dyn SqlWriter)
fn prepare_constant(&self, value: &Value, sql: &mut dyn SqlWriter)
Write
Value
inline.§fn prepare_values_list(
&self,
value_tuples: &[ValueTuple],
sql: &mut dyn SqlWriter,
)
fn prepare_values_list( &self, value_tuples: &[ValueTuple], sql: &mut dyn SqlWriter, )
Translate a
&[ValueTuple]
into a VALUES list.§fn prepare_tuple(&self, exprs: &[SimpleExpr], sql: &mut dyn SqlWriter)
fn prepare_tuple(&self, exprs: &[SimpleExpr], sql: &mut dyn SqlWriter)
Translate
SimpleExpr::Tuple
into SQL statement.§fn prepare_keyword(&self, keyword: &Keyword, sql: &mut dyn SqlWriter)
fn prepare_keyword(&self, keyword: &Keyword, sql: &mut dyn SqlWriter)
Translate
Keyword
into SQL statement.§fn value_to_string(&self, v: &Value) -> String
fn value_to_string(&self, v: &Value) -> String
Convert a SQL value into syntax-specific string
fn value_to_string_common(&self, v: &Value) -> String
fn prepare_on_conflict_action_common( &self, on_conflict_action: &Option<OnConflictAction>, sql: &mut dyn SqlWriter, )
§fn insert_default_values(&self, num_rows: u32, sql: &mut dyn SqlWriter)
fn insert_default_values(&self, num_rows: u32, sql: &mut dyn SqlWriter)
Write insert default rows expression.
§fn prepare_constant_true(&self, sql: &mut dyn SqlWriter)
fn prepare_constant_true(&self, sql: &mut dyn SqlWriter)
Write TRUE constant
§fn prepare_constant_false(&self, sql: &mut dyn SqlWriter)
fn prepare_constant_false(&self, sql: &mut dyn SqlWriter)
Write FALSE constant
§impl QuotedBuilder for MysqlQueryBuilder
impl QuotedBuilder for MysqlQueryBuilder
§impl TableBuilder for MysqlQueryBuilder
impl TableBuilder for MysqlQueryBuilder
§fn column_comment(&self, comment: &str, sql: &mut dyn SqlWriter)
fn column_comment(&self, comment: &str, sql: &mut dyn SqlWriter)
column comment
§fn 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.§fn 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.§fn 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.§fn 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.
§fn 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.§fn 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.§fn 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.§fn 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.§fn 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.§fn 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.§fn 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
§fn 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.§fn 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.§fn 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.§fn 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.§fn 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
§fn 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
§fn 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
.§impl TableRefBuilder for MysqlQueryBuilder
impl TableRefBuilder for MysqlQueryBuilder
§fn prepare_table_ref_iden(&self, table_ref: &TableRef, sql: &mut dyn SqlWriter)
fn prepare_table_ref_iden(&self, table_ref: &TableRef, sql: &mut dyn SqlWriter)
Translate
TableRef
that without values into SQL statement.impl GenericBuilder for MysqlQueryBuilder
impl SchemaBuilder for MysqlQueryBuilder
Auto Trait Implementations§
impl Freeze for MysqlQueryBuilder
impl RefUnwindSafe for MysqlQueryBuilder
impl Send for MysqlQueryBuilder
impl Sync for MysqlQueryBuilder
impl Unpin for MysqlQueryBuilder
impl UnwindSafe for MysqlQueryBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more