sea_query::backend

Trait QueryBuilder

source
pub trait QueryBuilder:
    QuotedBuilder
    + EscapeBuilder
    + TableRefBuilder
    + OperLeftAssocDecider
    + PrecedenceDecider {
Show 58 methods // Required methods fn prepare_query_statement( &self, query: &SubQueryStatement, sql: &mut dyn SqlWriter, ); fn prepare_value(&self, value: &Value, sql: &mut dyn SqlWriter); // Provided methods fn placeholder(&self) -> (&str, bool) { ... } fn values_list_tuple_prefix(&self) -> &str { ... } fn prepare_insert_statement( &self, insert: &InsertStatement, sql: &mut dyn SqlWriter, ) { ... } 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_limit_offset( &self, select: &SelectStatement, sql: &mut dyn SqlWriter, ) { ... } fn prepare_update_statement( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, ) { ... } fn prepare_update_order_by( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, ) { ... } fn prepare_update_limit( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, ) { ... } fn prepare_delete_statement( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, ) { ... } fn prepare_delete_order_by( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, ) { ... } fn prepare_delete_limit( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, ) { ... } fn prepare_simple_expr( &self, simple_expr: &SimpleExpr, sql: &mut dyn SqlWriter, ) { ... } 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_select_distinct( &self, select_distinct: &SelectDistinct, sql: &mut dyn SqlWriter, ) { ... } fn prepare_index_hints( &self, _select: &SelectStatement, _sql: &mut dyn SqlWriter, ) { ... } fn prepare_select_lock(&self, lock: &LockClause, sql: &mut dyn SqlWriter) { ... } fn prepare_select_expr( &self, select_expr: &SelectExpr, sql: &mut dyn SqlWriter, ) { ... } fn prepare_join_expr(&self, join_expr: &JoinExpr, sql: &mut dyn SqlWriter) { ... } 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_column_ref( &self, column_ref: &ColumnRef, sql: &mut dyn SqlWriter, ) { ... } fn prepare_un_oper(&self, un_oper: &UnOper, sql: &mut dyn SqlWriter) { ... } 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_sub_query_oper( &self, oper: &SubQueryOper, sql: &mut dyn SqlWriter, ) { ... } fn prepare_logical_chain_oper( &self, log_chain_oper: &LogicalChainOper, i: usize, length: usize, sql: &mut dyn SqlWriter, ) { ... } fn prepare_function_name_common( &self, function: &Function, sql: &mut dyn SqlWriter, ) { ... } 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_recursive_options( &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_query_clause_materialization( &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(&self, join_type: &JoinType, sql: &mut dyn SqlWriter) { ... } fn prepare_join_type_common( &self, join_type: &JoinType, sql: &mut dyn SqlWriter, ) { ... } fn prepare_order_expr( &self, order_expr: &OrderExpr, sql: &mut dyn SqlWriter, ) { ... } fn prepare_join_on(&self, join_on: &JoinOn, sql: &mut dyn SqlWriter) { ... } fn prepare_order(&self, order_expr: &OrderExpr, sql: &mut dyn SqlWriter) { ... } fn prepare_field_order( &self, order_expr: &OrderExpr, values: &Values, sql: &mut dyn SqlWriter, ) { ... } fn prepare_constant(&self, value: &Value, sql: &mut dyn SqlWriter) { ... } fn prepare_values_list( &self, value_tuples: &[ValueTuple], sql: &mut dyn SqlWriter, ) { ... } fn prepare_tuple(&self, exprs: &[SimpleExpr], sql: &mut dyn SqlWriter) { ... } fn prepare_keyword(&self, keyword: &Keyword, sql: &mut dyn SqlWriter) { ... } fn value_to_string(&self, v: &Value) -> 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_keyword(&self) -> &str { ... } fn insert_default_values(&self, num_rows: u32, sql: &mut dyn SqlWriter) { ... } fn prepare_constant_true(&self, sql: &mut dyn SqlWriter) { ... } fn prepare_constant_false(&self, sql: &mut dyn SqlWriter) { ... }
}

Required Methods§

source

fn prepare_query_statement( &self, query: &SubQueryStatement, sql: &mut dyn SqlWriter, )

Translate QueryStatement into SQL statement.

source

fn prepare_value(&self, value: &Value, sql: &mut dyn SqlWriter)

Write Value into SQL statement as parameter.

Provided Methods§

source

fn placeholder(&self) -> (&str, bool)

The type of placeholder the builder uses for values, and whether it is numbered.

source

fn values_list_tuple_prefix(&self) -> &str

Prefix for tuples in VALUES list (e.g. ROW for Mysql)

source

fn prepare_insert_statement( &self, insert: &InsertStatement, sql: &mut dyn SqlWriter, )

Translate InsertStatement into SQL statement.

source

fn prepare_union_statement( &self, union_type: UnionType, select_statement: &SelectStatement, sql: &mut dyn SqlWriter, )

source

fn prepare_select_statement( &self, select: &SelectStatement, sql: &mut dyn SqlWriter, )

Translate SelectStatement into SQL statement.

source

fn prepare_select_limit_offset( &self, select: &SelectStatement, sql: &mut dyn SqlWriter, )

source

fn prepare_update_statement( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, )

Translate UpdateStatement into SQL statement.

source

fn prepare_update_order_by( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, )

Translate ORDER BY expression in UpdateStatement.

source

fn prepare_update_limit( &self, update: &UpdateStatement, sql: &mut dyn SqlWriter, )

Translate LIMIT expression in UpdateStatement.

source

fn prepare_delete_statement( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, )

Translate DeleteStatement into SQL statement.

source

fn prepare_delete_order_by( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, )

Translate ORDER BY expression in DeleteStatement.

source

fn prepare_delete_limit( &self, delete: &DeleteStatement, sql: &mut dyn SqlWriter, )

Translate LIMIT expression in DeleteStatement.

source

fn prepare_simple_expr(&self, simple_expr: &SimpleExpr, sql: &mut dyn SqlWriter)

Translate SimpleExpr into SQL statement.

source

fn prepare_simple_expr_common( &self, simple_expr: &SimpleExpr, sql: &mut dyn SqlWriter, )

source

fn prepare_case_statement(&self, stmts: &CaseStatement, sql: &mut dyn SqlWriter)

Translate CaseStatement into SQL statement.

source

fn prepare_select_distinct( &self, select_distinct: &SelectDistinct, sql: &mut dyn SqlWriter, )

Translate SelectDistinct into SQL statement.

source

fn prepare_index_hints( &self, _select: &SelectStatement, _sql: &mut dyn SqlWriter, )

Translate [IndexHint] into SQL statement.

source

fn prepare_select_lock(&self, lock: &LockClause, sql: &mut dyn SqlWriter)

Translate LockType into SQL statement.

source

fn prepare_select_expr(&self, select_expr: &SelectExpr, sql: &mut dyn SqlWriter)

Translate SelectExpr into SQL statement.

source

fn prepare_join_expr(&self, join_expr: &JoinExpr, sql: &mut dyn SqlWriter)

Translate JoinExpr into SQL statement.

source

fn prepare_join_table_ref(&self, join_expr: &JoinExpr, sql: &mut dyn SqlWriter)

source

fn prepare_table_ref(&self, table_ref: &TableRef, sql: &mut dyn SqlWriter)

Translate TableRef into SQL statement.

source

fn prepare_column_ref(&self, column_ref: &ColumnRef, sql: &mut dyn SqlWriter)

source

fn prepare_un_oper(&self, un_oper: &UnOper, sql: &mut dyn SqlWriter)

Translate UnOper into SQL statement.

source

fn prepare_bin_oper_common(&self, bin_oper: &BinOper, sql: &mut dyn SqlWriter)

source

fn prepare_bin_oper(&self, bin_oper: &BinOper, sql: &mut dyn SqlWriter)

Translate BinOper into SQL statement.

source

fn prepare_sub_query_oper(&self, oper: &SubQueryOper, sql: &mut dyn SqlWriter)

Translate SubQueryOper into SQL statement.

source

fn prepare_logical_chain_oper( &self, log_chain_oper: &LogicalChainOper, i: usize, length: usize, sql: &mut dyn SqlWriter, )

Translate LogicalChainOper into SQL statement.

source

fn prepare_function_name_common( &self, function: &Function, sql: &mut dyn SqlWriter, )

Translate Function into SQL statement.

source

fn prepare_function_arguments( &self, func: &FunctionCall, sql: &mut dyn SqlWriter, )

source

fn prepare_with_query(&self, query: &WithQuery, sql: &mut dyn SqlWriter)

source

fn prepare_with_clause(&self, with_clause: &WithClause, sql: &mut dyn SqlWriter)

source

fn prepare_with_clause_recursive_options( &self, with_clause: &WithClause, sql: &mut dyn SqlWriter, )

source

fn prepare_with_clause_common_tables( &self, with_clause: &WithClause, sql: &mut dyn SqlWriter, )

source

fn prepare_with_query_clause_common_table( &self, cte: &CommonTableExpression, sql: &mut dyn SqlWriter, )

source

fn prepare_with_query_clause_materialization( &self, cte: &CommonTableExpression, sql: &mut dyn SqlWriter, )

source

fn prepare_with_clause_start( &self, with_clause: &WithClause, sql: &mut dyn SqlWriter, )

source

fn prepare_insert(&self, replace: bool, sql: &mut dyn SqlWriter)

source

fn prepare_function_name(&self, function: &Function, sql: &mut dyn SqlWriter)

source

fn prepare_join_type(&self, join_type: &JoinType, sql: &mut dyn SqlWriter)

Translate JoinType into SQL statement.

source

fn prepare_join_type_common( &self, join_type: &JoinType, sql: &mut dyn SqlWriter, )

source

fn prepare_order_expr(&self, order_expr: &OrderExpr, sql: &mut dyn SqlWriter)

Translate OrderExpr into SQL statement.

source

fn prepare_join_on(&self, join_on: &JoinOn, sql: &mut dyn SqlWriter)

Translate JoinOn into SQL statement.

source

fn prepare_order(&self, order_expr: &OrderExpr, sql: &mut dyn SqlWriter)

Translate Order into SQL statement.

source

fn prepare_field_order( &self, order_expr: &OrderExpr, values: &Values, sql: &mut dyn SqlWriter, )

Translate Order::Field into SQL statement

source

fn prepare_constant(&self, value: &Value, sql: &mut dyn SqlWriter)

Write Value inline.

source

fn prepare_values_list( &self, value_tuples: &[ValueTuple], sql: &mut dyn SqlWriter, )

Translate a &[ValueTuple] into a VALUES list.

source

fn prepare_tuple(&self, exprs: &[SimpleExpr], sql: &mut dyn SqlWriter)

Translate SimpleExpr::Tuple into SQL statement.

source

fn prepare_keyword(&self, keyword: &Keyword, sql: &mut dyn SqlWriter)

Translate Keyword into SQL statement.

source

fn value_to_string(&self, v: &Value) -> String

Convert a SQL value into syntax-specific string

source

fn value_to_string_common(&self, v: &Value) -> String

source

fn prepare_on_conflict_action_common( &self, on_conflict_action: &Option<OnConflictAction>, sql: &mut dyn SqlWriter, )

source

fn insert_default_keyword(&self) -> &str

The keywords for insert default row.

source

fn insert_default_values(&self, num_rows: u32, sql: &mut dyn SqlWriter)

Write insert default rows expression.

source

fn prepare_constant_true(&self, sql: &mut dyn SqlWriter)

Write TRUE constant

source

fn prepare_constant_false(&self, sql: &mut dyn SqlWriter)

Write FALSE constant

Implementors§

source§

impl QueryBuilder for MysqlQueryBuilder

Available on crate feature backend-mysql only.
source§

impl QueryBuilder for PostgresQueryBuilder

Available on crate feature backend-postgres only.
source§

impl QueryBuilder for SqliteQueryBuilder

Available on crate feature backend-sqlite only.