pub struct BoundSql { /* private fields */ }Expand description
A piece of SQL with the values it binds standing where they are bound.
No marker is written until the piece renders: an Expr made from it
binds each value in place, and build_after numbers
the markers after the values a statement already binds, so its text is
never read back for markers.
Implementations§
Source§impl BoundSql
impl BoundSql
Sourcepub fn push(&mut self, piece: impl BoundPiece) -> &mut Self
pub fn push(&mut self, piece: impl BoundPiece) -> &mut Self
Append piece.
Sourcepub fn join(items: impl IntoIterator<Item = BoundSql>, separator: &str) -> Self
pub fn join(items: impl IntoIterator<Item = BoundSql>, separator: &str) -> Self
items with separator between them.
Sourcepub fn build_after(
self,
dialect: &(impl SqlDialect + ?Sized),
values: &mut Vec<Value>,
) -> String
pub fn build_after( self, dialect: &(impl SqlDialect + ?Sized), values: &mut Vec<Value>, ) -> String
The SQL with dialect’s markers, numbered after the values already
in values, to which its own are appended.
Trait Implementations§
Source§impl BoundPiece for BoundSql
impl BoundPiece for BoundSql
Source§impl SqlWriter for BoundSql
impl SqlWriter for BoundSql
Source§fn push_param<T: QueryBuilder>(
&mut self,
value: Value,
_: &T,
) -> Result<(), RenderError>
fn push_param<T: QueryBuilder>( &mut self, value: Value, _: &T, ) -> Result<(), RenderError>
Writes
value’s marker and collects it, or, for a String, writes
the value itself, which fails for a value the backend cannot write.impl StructuralPartialEq for BoundSql
Source§impl Write for BoundSql
A query builder writes into a BoundSql with each value in place, so a
statement it renders can be spliced into another without reading markers.
impl Write for BoundSql
A query builder writes into a BoundSql with each value in place, so a
statement it renders can be spliced into another without reading markers.
Auto Trait Implementations§
impl Forget for BoundSql
impl Freeze for BoundSql
impl Move for BoundSql
impl RefUnwindSafe for BoundSql
impl Send for BoundSql
impl Sync for BoundSql
impl Unpin for BoundSql
impl UnsafeUnpin for BoundSql
impl UnwindSafe for BoundSql
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ExprTrait for T
impl<T> ExprTrait for T
Source§fn as_enum<N>(self, type_name: N) -> Exprwhere
N: IntoIden,
fn as_enum<N>(self, type_name: N) -> Exprwhere
N: IntoIden,
Express a
AS enum expression. Read moreSource§fn cast_as<N>(self, type_name: N) -> Exprwhere
N: IntoIden,
fn cast_as<N>(self, type_name: N) -> Exprwhere
N: IntoIden,
Express a
CAST AS expression. Read moreSource§fn count_distinct(self) -> Expr
fn count_distinct(self) -> Expr
Express a
COUNT function with the DISTINCT modifier. Read moreSource§fn equals<C>(self, col: C) -> Exprwhere
C: IntoColumnRef,
fn equals<C>(self, col: C) -> Exprwhere
C: IntoColumnRef,
Express a equal expression between two table columns,
you will mainly use this to relate identical value between two table columns. Read more
Source§fn in_subquery(self, sel: SelectStatement) -> Expr
fn in_subquery(self, sel: SelectStatement) -> Expr
Express a
IN sub-query expression. Read moreSource§fn in_tuples<V, I>(self, v: I) -> Exprwhere
V: IntoValueTuple,
I: IntoIterator<Item = V>,
fn in_tuples<V, I>(self, v: I) -> Exprwhere
V: IntoValueTuple,
I: IntoIterator<Item = V>,
Express a
IN sub expression. Read moreSource§fn is_not_null(self) -> Expr
fn is_not_null(self) -> Expr
Express a
IS NOT NULL expression. Read moreSource§fn left_shift<R>(self, right: R) -> Expr
fn left_shift<R>(self, right: R) -> Expr
Express a bitwise left shift. Read more
Source§fn not_between<A, B>(self, a: A, b: B) -> Expr
fn not_between<A, B>(self, a: A, b: B) -> Expr
Express a
NOT BETWEEN expression. Read moreSource§fn not_equals<C>(self, col: C) -> Exprwhere
C: IntoColumnRef,
fn not_equals<C>(self, col: C) -> Exprwhere
C: IntoColumnRef,
Express a not equal expression between two table columns,
you will mainly use this to relate identical value between two table columns. Read more
Source§fn not_in_subquery(self, sel: SelectStatement) -> Expr
fn not_in_subquery(self, sel: SelectStatement) -> Expr
Express a
NOT IN sub-query expression. Read moreSource§fn not_like<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
fn not_like<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
Express a
NOT LIKE expression. Read moreSource§fn right_shift<R>(self, right: R) -> Expr
fn right_shift<R>(self, right: R) -> Expr
Express a bitwise right shift. Read more
Source§impl<T> PgExpr for Twhere
T: ExprTrait,
impl<T> PgExpr for Twhere
T: ExprTrait,
Source§fn concatenate<T>(self, right: T) -> Expr
fn concatenate<T>(self, right: T) -> Expr
Express an postgres concatenate (
||) expression. Read moreSource§fn matches<T>(self, expr: T) -> Expr
fn matches<T>(self, expr: T) -> Expr
Express an postgres fulltext search matches (
@@) expression. Read moreSource§fn contains<T>(self, expr: T) -> Expr
fn contains<T>(self, expr: T) -> Expr
Express an postgres fulltext search contains (
@>) expression. Read moreSource§fn contained<T>(self, expr: T) -> Expr
fn contained<T>(self, expr: T) -> Expr
Express an postgres fulltext search contained (
<@) expression. Read moreSource§fn ilike<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
fn ilike<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
Express a
ILIKE expression. Read moreSource§fn not_ilike<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
fn not_ilike<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
Express a
NOT ILIKE expressionSource§fn get_json_field<T>(self, right: T) -> Expr
fn get_json_field<T>(self, right: T) -> Expr
Express a postgres retrieves JSON field as JSON value (
->). Read moreSource§fn cast_json_field<T>(self, right: T) -> Expr
fn cast_json_field<T>(self, right: T) -> Expr
Express a postgres retrieves JSON field and casts it to an appropriate SQL type (
->>). Read more