pub struct SqliteQueryBuilder;Expand description
Sqlite query builder.
Trait Implementations§
Source§impl Debug for SqliteQueryBuilder
impl Debug for SqliteQueryBuilder
Source§impl Default for SqliteQueryBuilder
impl Default for SqliteQueryBuilder
Source§impl EscapeBuilder for SqliteQueryBuilder
impl EscapeBuilder for SqliteQueryBuilder
fn write_escaped(&self, buffer: &mut impl Write, string: &str)
Source§fn needs_escape(&self, s: &str) -> bool
fn needs_escape(&self, s: &str) -> bool
Source§fn escape_string(&self, string: &str) -> String
fn escape_string(&self, string: &str) -> String
Source§impl OperLeftAssocDecider for SqliteQueryBuilder
impl OperLeftAssocDecider for SqliteQueryBuilder
fn well_known_left_associative(&self, op: &BinOper) -> bool
Source§impl QueryBuilder for SqliteQueryBuilder
impl QueryBuilder for SqliteQueryBuilder
Source§fn lexer_dialect(&self) -> Dialect
fn lexer_dialect(&self) -> Dialect
Source§fn prepare_expr(
&self,
simple_expr: &Expr,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_expr( &self, simple_expr: &Expr, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
Expr into SQL statement.Source§fn prepare_select_lock(
&self,
_select_lock: &LockClause,
_sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_select_lock( &self, _select_lock: &LockClause, _sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
LockType into SQL statement.fn prepare_select_into( &self, _: &SelectInto, _: &mut impl SqlWriter, ) -> Result<(), RenderError>
Source§fn prepare_sub_query_oper(
&self,
oper: &SubQueryOper,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_sub_query_oper( &self, oper: &SubQueryOper, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
SubQueryOper into SQL statement.Source§fn prepare_bin_oper(
&self,
bin_oper: &BinOper,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_bin_oper( &self, bin_oper: &BinOper, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
BinOper into SQL statement.fn prepare_union_statement( &self, union_type: UnionType, select_statement: &SelectStatement, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
fn prepare_select_limit_offset( &self, select: &SelectStatement, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
Source§fn insert_default_values(
&self,
num_rows: usize,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn insert_default_values( &self, num_rows: usize, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
Source§fn placeholder(&self) -> (&'static str, bool)
fn placeholder(&self) -> (&'static str, bool)
Source§fn values_list_tuple_prefix(&self) -> &str
fn values_list_tuple_prefix(&self) -> &str
fn prepare_update_join( &self, from: &[TableRef], condition: &ConditionHolder, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
fn prepare_update_from( &self, from: &[TableRef], sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
fn prepare_update_column( &self, table: &Option<Box<TableRef>>, from: &[TableRef], column: &DynIden, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
fn prepare_update_condition( &self, from: &[TableRef], condition: &ConditionHolder, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
Source§fn prepare_select_distinct(
&self,
select_distinct: &SelectDistinct,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_select_distinct( &self, select_distinct: &SelectDistinct, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
SelectDistinct into SQL statement.Source§fn prepare_query_statement(
&self,
query: &SubQueryStatement,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_query_statement( &self, query: &SubQueryStatement, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
QueryStatement into SQL statement.fn prepare_with_query_clause_materialization( &self, cte: &CommonTableExpression, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
fn prepare_function_name( &self, function: &Func, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
Source§fn prepare_join_type(
&self,
join_type: &JoinType,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_join_type( &self, join_type: &JoinType, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
JoinType into SQL statement.Source§fn prepare_order_expr(
&self,
order_expr: &OrderExpr,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_order_expr( &self, order_expr: &OrderExpr, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
OrderExpr into SQL statement.Source§fn prepare_value(
&self,
value: Value,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_value( &self, value: Value, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
Value into SQL statement as parameter.fn write_string_quoted(&self, string: &str, buffer: &mut impl Write)
Source§fn insert_default_keyword(&self) -> &str
fn insert_default_keyword(&self) -> &str
Source§impl QuotedBuilder for SqliteQueryBuilder
impl QuotedBuilder for SqliteQueryBuilder
Source§impl SqlDialect for SqliteQueryBuilder
impl SqlDialect for SqliteQueryBuilder
Source§fn json_equals(&self, column: &str, value: &Value, negate: bool) -> BoundSql
fn json_equals(&self, column: &str, value: &Value, negate: bool) -> BoundSql
SQLite compares JSON only as text, so the document’s structure is compared instead. A NULL column matches neither the test nor its negation.
Source§fn json_exists(
&self,
column: &str,
existence: JsonExistence,
target: &str,
negate: bool,
) -> Result<BoundSql, RenderError>
fn json_exists( &self, column: &str, existence: JsonExistence, target: &str, negate: bool, ) -> Result<BoundSql, RenderError>
json_type is strict already, and finds a member holding JSON null,
which json_extract reports as SQL NULL.
Source§fn array_predicate(
&self,
column: &str,
operator: ArrayOperator,
elements: Vec<Value>,
_null_allowed: bool,
) -> BoundSql
fn array_predicate( &self, column: &str, operator: ArrayOperator, elements: Vec<Value>, _null_allowed: bool, ) -> BoundSql
Elements are compared as JSON values, as json_equals compares a
document: 1 is not true, and the string "{\"a\":1}" is not that
object. A null in a contained-by list admits null elements, and a NULL
column has no elements to test, so it is contained by nothing, as
PostgreSQL’s <@ leaves it.
Source§fn array_append(&self, column: &str, element: Value) -> BoundSql
fn array_append(&self, column: &str, element: Value) -> BoundSql
A document that is no array becomes the first element of one, as
MySQL’s JSON_ARRAY_APPEND wraps it.
Source§fn array_remove(&self, column: &str, source: &str, element: Value) -> BoundSql
fn array_remove(&self, column: &str, source: &str, element: Value) -> BoundSql
The kept elements are extracted as JSON text, not json_each.value:
SQL REAL rounds large integers, and rebuilding from it would corrupt
untouched values.
Source§fn json_set(
&self,
column: &str,
path: &[JsonPathStep],
value: &Value,
) -> BoundSql
fn json_set( &self, column: &str, path: &[JsonPathStep], value: &Value, ) -> BoundSql
SQLite’s own json_set would create missing parents and ignore an
index past an array’s end. json_type of a missing parent is NULL,
which IS NOT counts as another type.
Source§fn literal_match(
&self,
column: &str,
literal: &str,
leading: bool,
trailing: bool,
) -> Result<BoundSql, RenderError>
fn literal_match( &self, column: &str, literal: &str, leading: bool, trailing: bool, ) -> Result<BoundSql, RenderError>
LIKE stops at a stored NUL. Blob slicing and search after ASCII case
folding (where LIKE folds case) preserve the whole text, NULs
included; lower() stops at a NUL in literal, which is refused.
Source§fn in_list(&self, column: Expr, values: Vec<Value>, negated: bool) -> Expr
fn in_list(&self, column: Expr, values: Vec<Value>, negated: bool) -> Expr
A long text list is read from one JSON array parameter. Other types keep their bound form: a UUID is stored as a blob, and a timestamp as text in a format its JSON form does not share.
Source§fn identifier_quote(&self) -> Quote
fn identifier_quote(&self) -> Quote
Source§fn numbered_markers(&self) -> bool
fn numbered_markers(&self) -> bool
$1). Read moreSource§fn expression(
&self,
sql: String,
values: Vec<Value>,
) -> Result<Expr, RenderError>
fn expression( &self, sql: String, values: Vec<Value>, ) -> Result<Expr, RenderError>
Source§fn inline_values(
&self,
sql: &str,
values: &[Value],
) -> Result<String, RenderError>
fn inline_values( &self, sql: &str, values: &[Value], ) -> Result<String, RenderError>
sql with values written in place of its markers, for display.Source§fn string_literal(&self, text: &str) -> String
fn string_literal(&self, text: &str) -> String
text as a quoted string literal, escaped as inline_values
writes one, for SQL that cannot bind it: DDL, or a constant an index
expression must match.Source§fn json_containment(
&self,
column: &str,
value: &Value,
containment: JsonContainment,
) -> BoundSql
fn json_containment( &self, column: &str, value: &Value, containment: JsonContainment, ) -> BoundSql
column against value.Source§fn open_limit(&self) -> Option<&'static str>
fn open_limit(&self) -> Option<&'static str>
OFFSET.Source§fn exact_key(&self, column: &str) -> String
fn exact_key(&self, column: &str) -> String
column as a value that compares byte for byte, whatever its
collation, so two spellings a case- or accent-insensitive collation
matches stay apart.Source§fn push_identifier(&self, out: &mut String, name: &str)
fn push_identifier(&self, out: &mut String, name: &str)
name to out as a quoted identifier, doubling any quote inside it.Source§fn native_arrays(&self) -> bool
fn native_arrays(&self) -> bool
Source§fn window_default(
&self,
function: &str,
column: &str,
offset: &str,
default: &str,
over: &str,
) -> String
fn window_default( &self, function: &str, column: &str, offset: &str, default: &str, over: &str, ) -> String
LAG or LEAD (function) with a default, over the window over.Source§fn limit_in_subquery(&self) -> bool
fn limit_in_subquery(&self) -> bool
IN (..) subquery may carry a LIMIT.Source§fn groups_frames(&self) -> bool
fn groups_frames(&self) -> bool
GROUPS.Source§fn update_limit(&self) -> bool
fn update_limit(&self) -> bool
UPDATE takes ORDER BY and LIMIT itself. Where it does
not, a capped update is scoped through a primary-key subquery; the
builder renders an UpdateStatement’s limit
as it is told.Source§impl TableRefBuilder for SqliteQueryBuilder
impl TableRefBuilder for SqliteQueryBuilder
Source§fn prepare_table_ref_iden(
&self,
table_ref: &TableRef,
sql: &mut impl SqlWriter,
) -> Result<(), RenderError>
fn prepare_table_ref_iden( &self, table_ref: &TableRef, sql: &mut impl SqlWriter, ) -> Result<(), RenderError>
TableRef that without values into SQL statement.Source§fn prepare_table_name(&self, table_name: &TableName, sql: &mut impl SqlWriter)
fn prepare_table_name(&self, table_name: &TableName, sql: &mut impl SqlWriter)
TableName into an SQL statement.Source§fn prepare_schema_name(
&self,
schema_name: &SchemaName,
sql: &mut impl SqlWriter,
)
fn prepare_schema_name( &self, schema_name: &SchemaName, sql: &mut impl SqlWriter, )
SchemaName into an SQL statement.