pub struct SqlLiteral<ST, T = Empty> { /* private fields */ }Expand description
Returned by the sql() function.
Implementations§
Source§impl<ST, T> SqlLiteral<ST, T>where
ST: TypedExpressionType,
impl<ST, T> SqlLiteral<ST, T>where
ST: TypedExpressionType,
Sourcepub fn bind<BindST, U>(
self,
bind_value: U,
) -> UncheckedBind<Self, U::Expression>
pub fn bind<BindST, U>( self, bind_value: U, ) -> UncheckedBind<Self, U::Expression>
Bind a value for use with this SQL query.
§Safety
This function should be used with care, as Diesel cannot validate that the value is of the right type nor can it validate that you have passed the correct number of parameters.
§Examples
let seans_id = users
.select(id)
.filter(sql::<Bool>("name = ").bind::<Text, _>("Sean"))
.get_result(connection);
assert_eq!(Ok(1), seans_id);
let tess_id = sql::<Integer>("SELECT id FROM users WHERE name = ")
.bind::<Text, _>("Tess")
.get_result(connection);
assert_eq!(Ok(2), tess_id);§Multiple Bind Params
let query = users
.select(name)
.filter(
sql::<Bool>("id > ")
.bind::<Integer, _>(1)
.sql(" AND name <> ")
.bind::<Text, _>("Ryan"),
)
.get_results(connection);
let expected = vec!["Tess".to_string()];
assert_eq!(Ok(expected), query);Sourcepub fn sql(self, sql: &str) -> SqlLiteral<ST, Self>
pub fn sql(self, sql: &str) -> SqlLiteral<ST, Self>
Use literal SQL in the query builder
This function is intended for use when you need a small bit of raw SQL in
your query. If you want to write the entire query using raw SQL, use
sql_query instead.
§Safety
This function should be used with care, as Diesel cannot validate that the value is of the right type nor can it validate that you have passed the correct number of parameters.
§Examples
let query = users
.select(name)
.filter(sql::<Bool>("id > 1").sql(" AND name <> 'Ryan'"))
.get_results(connection);
let expected = vec!["Tess".to_string()];
assert_eq!(Ok(expected), query);Trait Implementations§
Source§impl<ST, T, __Rhs> Add<__Rhs> for SqlLiteral<ST, T>where
Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType + SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs>,
impl<ST, T, __Rhs> Add<__Rhs> for SqlLiteral<ST, T>where
Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType + SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs>,
Source§type Output = Add<SqlLiteral<ST, T>, <__Rhs as AsExpression<<<SqlLiteral<ST, T> as Expression>::SqlType as Add>::Rhs>>::Expression>
type Output = Add<SqlLiteral<ST, T>, <__Rhs as AsExpression<<<SqlLiteral<ST, T> as Expression>::SqlType as Add>::Rhs>>::Expression>
The resulting type after applying the
+ operator.impl<QS, ST, T> AppearsOnTable<QS> for SqlLiteral<ST, T>where
Self: Expression,
Source§impl<ST: Clone, T: Clone> Clone for SqlLiteral<ST, T>
impl<ST: Clone, T: Clone> Clone for SqlLiteral<ST, T>
Source§fn clone(&self) -> SqlLiteral<ST, T>
fn clone(&self) -> SqlLiteral<ST, T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<ST, T, __Rhs> Div<__Rhs> for SqlLiteral<ST, T>where
Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType + SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs>,
impl<ST, T, __Rhs> Div<__Rhs> for SqlLiteral<ST, T>where
Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType + SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs>,
Source§type Output = Div<SqlLiteral<ST, T>, <__Rhs as AsExpression<<<SqlLiteral<ST, T> as Expression>::SqlType as Div>::Rhs>>::Expression>
type Output = Div<SqlLiteral<ST, T>, <__Rhs as AsExpression<<<SqlLiteral<ST, T> as Expression>::SqlType as Div>::Rhs>>::Expression>
The resulting type after applying the
/ operator.Source§impl<ST, T> Expression for SqlLiteral<ST, T>where
ST: TypedExpressionType,
impl<ST, T> Expression for SqlLiteral<ST, T>where
ST: TypedExpressionType,
Source§impl<ST, T, __Rhs> Mul<__Rhs> for SqlLiteral<ST, T>where
Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType + SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs>,
impl<ST, T, __Rhs> Mul<__Rhs> for SqlLiteral<ST, T>where
Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType + SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs>,
Source§type Output = Mul<SqlLiteral<ST, T>, <__Rhs as AsExpression<<<SqlLiteral<ST, T> as Expression>::SqlType as Mul>::Rhs>>::Expression>
type Output = Mul<SqlLiteral<ST, T>, <__Rhs as AsExpression<<<SqlLiteral<ST, T> as Expression>::SqlType as Mul>::Rhs>>::Expression>
The resulting type after applying the
* operator.Source§impl<ST, T> Query for SqlLiteral<ST, T>where
Self: Expression,
impl<ST, T> Query for SqlLiteral<ST, T>where
Self: Expression,
Source§impl<ST, T, DB> QueryFragment<DB> for SqlLiteral<ST, T>where
DB: Backend,
T: QueryFragment<DB>,
impl<ST, T, DB> QueryFragment<DB> for SqlLiteral<ST, T>where
DB: Backend,
T: QueryFragment<DB>,
Source§fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, DB>) -> QueryResult<()>
fn walk_ast<'b>(&'b self, out: AstPass<'_, 'b, DB>) -> QueryResult<()>
Walk over this
QueryFragment for all passes. Read moreSource§fn to_sql(&self, out: &mut DB::QueryBuilder, backend: &DB) -> QueryResult<()>
fn to_sql(&self, out: &mut DB::QueryBuilder, backend: &DB) -> QueryResult<()>
Converts this
QueryFragment to its SQL representation. Read moreSource§fn collect_binds<'b>(
&'b self,
out: &mut DB::BindCollector<'b>,
metadata_lookup: &mut DB::MetadataLookup,
backend: &'b DB,
) -> QueryResult<()>
fn collect_binds<'b>( &'b self, out: &mut DB::BindCollector<'b>, metadata_lookup: &mut DB::MetadataLookup, backend: &'b DB, ) -> QueryResult<()>
Serializes all bind parameters in this query. Read more
Source§fn is_safe_to_cache_prepared(&self, backend: &DB) -> QueryResult<bool>
fn is_safe_to_cache_prepared(&self, backend: &DB) -> QueryResult<bool>
Is this query safe to store in the prepared statement cache? Read more
Source§impl<ST, T> QueryId for SqlLiteral<ST, T>
impl<ST, T> QueryId for SqlLiteral<ST, T>
Source§const HAS_STATIC_QUERY_ID: bool = false
const HAS_STATIC_QUERY_ID: bool = false
Can the SQL generated by
Self be uniquely identified by its type? Read moreimpl<ST, T> RunQueryDslSupport for SqlLiteral<ST, T>
impl<QS, ST, T> SelectableExpression<QS> for SqlLiteral<ST, T>where
Self: Expression,
Source§impl<ST, T, __Rhs> Sub<__Rhs> for SqlLiteral<ST, T>where
Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType + SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs>,
impl<ST, T, __Rhs> Sub<__Rhs> for SqlLiteral<ST, T>where
Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType + SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs>,
Source§type Output = Sub<SqlLiteral<ST, T>, <__Rhs as AsExpression<<<SqlLiteral<ST, T> as Expression>::SqlType as Sub>::Rhs>>::Expression>
type Output = Sub<SqlLiteral<ST, T>, <__Rhs as AsExpression<<<SqlLiteral<ST, T> as Expression>::SqlType as Sub>::Rhs>>::Expression>
The resulting type after applying the
- operator.Source§impl<ST, T, GB> ValidGrouping<GB> for SqlLiteral<ST, T>
impl<ST, T, GB> ValidGrouping<GB> for SqlLiteral<ST, T>
Source§type IsAggregate = Never
type IsAggregate = Never
Is this expression aggregate? Read more
Auto Trait Implementations§
impl<ST, T> Freeze for SqlLiteral<ST, T>
impl<ST, T> RefUnwindSafe for SqlLiteral<ST, T>
impl<ST, T> Send for SqlLiteral<ST, T>
impl<ST, T> Sync for SqlLiteral<ST, T>
impl<ST, T> Unpin for SqlLiteral<ST, T>
impl<ST, T> UnsafeUnpin for SqlLiteral<ST, T>
impl<ST, T> UnwindSafe for SqlLiteral<ST, T>
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> AggregateDistinct<Self>where
Self: DistinctDsl,
fn aggregate_distinct(self) -> AggregateDistinct<Self>where
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> AggregateAll<Self>where
Self: AllDsl,
fn aggregate_all(self) -> AggregateAll<Self>where
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> AggregateFilter<Self, P>
fn aggregate_filter<P>(self, f: P) -> AggregateFilter<Self, P>
Add an aggregate function filter Read more
Source§fn aggregate_order<O>(self, o: O) -> AggregateOrder<Self, O>where
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> AggregateOrder<Self, O>where
Self: OrderAggregateDsl<O>,
Add an aggregate function order Read more
Source§impl<T> AnyJsonExpressionMethods for T
impl<T> AnyJsonExpressionMethods for T
Source§fn retrieve_as_text<T>(self, other: T) -> RetrieveAsText<Self, T>
fn retrieve_as_text<T>(self, other: T) -> RetrieveAsText<Self, T>
Available on crate features
__sqlite-shared or postgres_backend only.Creates a
->> expression JSON. Read moreSource§impl<T, ST> AsExpression<ST> for T
impl<T, ST> AsExpression<ST> for T
Source§type Expression = T
type Expression = T
The expression being returned
Source§fn as_expression(self) -> T
fn as_expression(self) -> T
Perform the conversion
Source§impl<T, ST> AsExpressionList<ST> for T
impl<T, ST> AsExpressionList<ST> for T
Source§type Expression = <T as IntoArrayExpression<ST>>::ArrayExpression
type Expression = <T as IntoArrayExpression<ST>>::ArrayExpression
👎Deprecated:
Use IntoArrayExpression instead
Available on crate feature
with-deprecated and non-crate feature without-deprecated only.The final output expression
Source§fn as_expression_list(self) -> <T as AsExpressionList<ST>>::Expression
fn as_expression_list(self) -> <T as AsExpressionList<ST>>::Expression
👎Deprecated:
Use IntoArrayExpression instead
Available on crate feature
with-deprecated and non-crate feature without-deprecated only.Perform the conversion
Source§impl<T> BoolExpressionMethods for T
impl<T> BoolExpressionMethods for T
Source§fn and<T, ST>(self, other: T) -> And<Self, T, ST>where
Self::SqlType: SqlType,
ST: SqlType + TypedExpressionType + BoolOrNullableBool,
T: AsExpression<ST>,
And<Self, T::Expression>: Expression,
fn and<T, ST>(self, other: T) -> And<Self, T, ST>where
Self::SqlType: SqlType,
ST: SqlType + TypedExpressionType + BoolOrNullableBool,
T: AsExpression<ST>,
And<Self, T::Expression>: Expression,
Creates a SQL
AND expression Read moreSource§fn or<T, ST>(self, other: T) -> Or<Self, T, ST>where
Self::SqlType: SqlType,
ST: SqlType + TypedExpressionType + BoolOrNullableBool,
T: AsExpression<ST>,
Or<Self, T::Expression>: Expression,
fn or<T, ST>(self, other: T) -> Or<Self, T, ST>where
Self::SqlType: SqlType,
ST: SqlType + TypedExpressionType + BoolOrNullableBool,
T: AsExpression<ST>,
Or<Self, T::Expression>: Expression,
Creates a SQL
OR expression Read moreSource§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<QS, T, DB, GB, IsAggregate> BoxableExpression<QS, DB, GB, IsAggregate> for Twhere
DB: Backend,
T: Expression + SelectableExpression<QS> + ValidGrouping<GB> + QueryFragment<DB> + Send,
<T as ValidGrouping<GB>>::IsAggregate: MixedAggregates<IsAggregate, Output = IsAggregate>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<Conn, DB, T> ExecuteDsl<Conn, DB> for T
impl<Conn, DB, T> ExecuteDsl<Conn, DB> for T
Source§impl<T> ExpressionMethods for T
impl<T> ExpressionMethods for T
Source§fn is_not_null(self) -> IsNotNull<Self>
fn is_not_null(self) -> IsNotNull<Self>
Creates a SQL
IS NOT NULL expression. Read moreSource§fn between<T, U>(self, lower: T, upper: U) -> Between<Self, T, U>
fn between<T, U>(self, lower: T, upper: U) -> Between<Self, T, U>
Creates a SQL
BETWEEN expression using the given lower and upper
bounds. Read moreSource§fn not_between<T, U>(self, lower: T, upper: U) -> NotBetween<Self, T, U>
fn not_between<T, U>(self, lower: T, upper: U) -> NotBetween<Self, T, U>
Creates a SQL
NOT BETWEEN expression using the given lower and upper
bounds. Read moreSource§fn fallible_cast<ST>(self) -> Cast<Self, ST>
fn fallible_cast<ST>(self) -> Cast<Self, ST>
Source§impl<ST, T> IntoArrayExpression<ST> for T
impl<ST, T> IntoArrayExpression<ST> for T
Source§type ArrayExpression = <T as AsExpression<Array<ST>>>::Expression
type ArrayExpression = <T as AsExpression<Array<ST>>>::Expression
Available on crate feature
postgres_backend only.Type of the expression returned by IntoArrayExpression::into_array_expression
Source§fn into_array_expression(
self,
) -> <T as IntoArrayExpression<ST>>::ArrayExpression
fn into_array_expression( self, ) -> <T as IntoArrayExpression<ST>>::ArrayExpression
Available on crate feature
postgres_backend only.Construct the diesel query dsl representation of
the
ARRAY (values) clause for the given typeSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§impl<T> JsonIndex for T
impl<T> JsonIndex for T
type Expression = T
fn into_json_index_expression(self) -> <T as JsonIndex>::Expression
Source§impl<'query, Conn, T, U, DB, B> LoadQuery<'query, Conn, U, B> for Twhere
Conn: Connection<Backend = DB> + LoadConnection<B>,
T: AsQuery + RunQueryDsl<Conn>,
<T as AsQuery>::Query: QueryFragment<DB> + QueryId + 'query,
<T as AsQuery>::SqlType: CompatibleType<U, DB>,
DB: Backend + QueryMetadata<<T as AsQuery>::SqlType> + 'static,
U: FromSqlRow<<<T as AsQuery>::SqlType as CompatibleType<U, DB>>::SqlType, DB> + 'static,
<<T as AsQuery>::SqlType as CompatibleType<U, DB>>::SqlType: 'static,
impl<'query, Conn, T, U, DB, B> LoadQuery<'query, Conn, U, B> for Twhere
Conn: Connection<Backend = DB> + LoadConnection<B>,
T: AsQuery + RunQueryDsl<Conn>,
<T as AsQuery>::Query: QueryFragment<DB> + QueryId + 'query,
<T as AsQuery>::SqlType: CompatibleType<U, DB>,
DB: Backend + QueryMetadata<<T as AsQuery>::SqlType> + 'static,
U: FromSqlRow<<<T as AsQuery>::SqlType as CompatibleType<U, DB>>::SqlType, DB> + 'static,
<<T as AsQuery>::SqlType as CompatibleType<U, DB>>::SqlType: 'static,
Source§type RowIter<'conn> = LoadIter<U, <Conn as LoadConnection<B>>::Cursor<'conn, 'query>, <<T as AsQuery>::SqlType as CompatibleType<U, DB>>::SqlType, DB>
where
Conn: 'conn
type RowIter<'conn> = LoadIter<U, <Conn as LoadConnection<B>>::Cursor<'conn, 'query>, <<T as AsQuery>::SqlType as CompatibleType<U, DB>>::SqlType, DB> where Conn: 'conn
Return type of
LoadQuery::internal_loadimpl<T> NonAggregate for Twhere
T: ValidGrouping<()>,
<T as ValidGrouping<()>>::IsAggregate: MixedAggregates<No, Output = No>,
Source§impl<T> NullableExpressionMethods for Twhere
T: Expression,
impl<T> NullableExpressionMethods for Twhere
T: Expression,
Source§fn nullable(self) -> Nullable<Self>
fn nullable(self) -> Nullable<Self>
Converts this potentially non-null expression into one which is treated
as nullable. This method has no impact on the generated SQL, and is only
used to allow certain comparisons that would otherwise fail to compile. Read more
Source§fn assume_not_null(self) -> AssumeNotNull<Self>
fn assume_not_null(self) -> AssumeNotNull<Self>
Converts this potentially nullable expression into one which will be assumed
to be not-null. This method has no impact on the generated SQL, however it will
enable you to attempt deserialization of the returned value in a non-
Option. Read moreSource§impl<T> PgAnyJsonExpressionMethods for T
impl<T> PgAnyJsonExpressionMethods for T
Source§fn retrieve_as_object<T>(self, other: T) -> RetrieveAsObject<Self, T>
fn retrieve_as_object<T>(self, other: T) -> RetrieveAsObject<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
-> expression. Read moreSource§fn retrieve_by_path_as_object<T>(
self,
other: T,
) -> RetrieveByPathAsObjectJson<Self, T::Expression>
fn retrieve_by_path_as_object<T>( self, other: T, ) -> RetrieveByPathAsObjectJson<Self, T::Expression>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
#> expression. Read moreSource§fn retrieve_by_path_as_text<T>(
self,
other: T,
) -> RetrieveByPathAsTextJson<Self, T::Expression>
fn retrieve_by_path_as_text<T>( self, other: T, ) -> RetrieveByPathAsTextJson<Self, T::Expression>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
#>> expression. Read moreSource§impl<T> PgArrayExpressionMethods for T
impl<T> PgArrayExpressionMethods for T
Source§fn overlaps_with<T>(self, other: T) -> OverlapsWith<Self, T>
fn overlaps_with<T>(self, other: T) -> OverlapsWith<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
&& expression. Read moreSource§fn contains<T>(self, other: T) -> Contains<Self, T>
fn contains<T>(self, other: T) -> Contains<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
@> expression. Read moreSource§fn is_contained_by<T>(self, other: T) -> IsContainedBy<Self, T>
fn is_contained_by<T>(self, other: T) -> IsContainedBy<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
<@ expression. Read moreSource§fn index<T>(self, other: T) -> Index<Self, T>
fn index<T>(self, other: T) -> Index<Self, T>
Available on crate feature
postgres_backend only.Indexes a PostgreSQL array. Read more
Source§fn index_nullable<T>(self, other: T) -> IndexNullable<Self, T>
fn index_nullable<T>(self, other: T) -> IndexNullable<Self, T>
Available on crate feature
postgres_backend only.Indexes a PostgreSQL array. This is the same as
PgArrayExpressionMethods::index
but takes a nullable expression for the parameter. Read moreSource§fn slice<T1, T2>(self, start: T1, end: T2) -> Slice<Self, T1, T2>
fn slice<T1, T2>(self, start: T1, end: T2) -> Slice<Self, T1, T2>
Available on crate feature
postgres_backend only.Indexes a PostgreSQL array with the slice delimited by the given indexes. Read more
Source§fn slice_nullable<T1, T2>(
self,
start: T1,
end: T2,
) -> SliceNullable<Self, T1, T2>where
Self::SqlType: SqlType,
T1: AsExpression<Nullable<Integer>>,
T2: AsExpression<Nullable<Integer>>,
fn slice_nullable<T1, T2>(
self,
start: T1,
end: T2,
) -> SliceNullable<Self, T1, T2>where
Self::SqlType: SqlType,
T1: AsExpression<Nullable<Integer>>,
T2: AsExpression<Nullable<Integer>>,
Available on crate feature
postgres_backend only.Indexes a PostgreSQL array with the slice delimited by the given indexes.
This is the same as
PgArrayExpressionMethods::slice
but takes nullable expressions for the parameters. Read moreSource§fn slice_from<T>(self, start: T) -> SliceFrom<Self, T>
fn slice_from<T>(self, start: T) -> SliceFrom<Self, T>
Available on crate feature
postgres_backend only.Indexes a PostgreSQL array with the slice starting from the given index. Read more
Source§fn slice_from_nullable<T>(self, start: T) -> SliceFromNullable<Self, T>
fn slice_from_nullable<T>(self, start: T) -> SliceFromNullable<Self, T>
Available on crate feature
postgres_backend only.Indexes a PostgreSQL array with the slice starting from the given index.
This is the same as
PgArrayExpressionMethods::slice_from
but takes a nullable expression for the parameter. Read moreSource§fn slice_to<T>(self, end: T) -> SliceTo<Self, T>
fn slice_to<T>(self, end: T) -> SliceTo<Self, T>
Available on crate feature
postgres_backend only.Indexes a PostgreSQL array with the slice ending with the given index. Read more
Source§fn slice_to_nullable<T>(self, end: T) -> SliceToNullable<Self, T>
fn slice_to_nullable<T>(self, end: T) -> SliceToNullable<Self, T>
Available on crate feature
postgres_backend only.Indexes a PostgreSQL array with the slice ending with the given index.
This is the same as
PgArrayExpressionMethods::slice_to
but takes a nullable expression for the parameter. Read moreSource§impl<T> PgBinaryExpressionMethods for T
impl<T> PgBinaryExpressionMethods for T
Source§fn concat<T>(self, other: T) -> Concat<Self, T>
fn concat<T>(self, other: T) -> Concat<Self, T>
Available on crate feature
postgres_backend only.Concatenates two PostgreSQL byte arrays using the
|| operator. Read moreSource§impl<T> PgExpressionMethods for Twhere
T: Expression,
impl<T> PgExpressionMethods for Twhere
T: Expression,
Source§fn is_not_distinct_from<T>(self, other: T) -> IsNotDistinctFrom<Self, T>
fn is_not_distinct_from<T>(self, other: T) -> IsNotDistinctFrom<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS NOT DISTINCT FROM expression. Read moreSource§fn is_distinct_from<T>(self, other: T) -> IsDistinctFrom<Self, T>
fn is_distinct_from<T>(self, other: T) -> IsDistinctFrom<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS DISTINCT FROM expression. Read moreSource§fn is_contained_by_range<T>(self, other: T) -> IsContainedByRange<Self, T>
fn is_contained_by_range<T>(self, other: T) -> IsContainedByRange<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
<@ expression. Read moreSource§impl<T> PgJsonbExpressionMethods for T
impl<T> PgJsonbExpressionMethods for T
Source§fn concat<T>(self, other: T) -> Concat<Self, T>
fn concat<T>(self, other: T) -> Concat<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
|| expression. Read moreSource§fn has_key<T>(self, other: T) -> HasKeyJsonb<Self, T>where
T: AsExpression<VarChar>,
fn has_key<T>(self, other: T) -> HasKeyJsonb<Self, T>where
T: AsExpression<VarChar>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
? expression. Read moreSource§fn has_any_key<T>(self, other: T) -> HasAnyKeyJsonb<Self, T>
fn has_any_key<T>(self, other: T) -> HasAnyKeyJsonb<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
?| expression. Read moreSource§fn has_all_keys<T>(self, other: T) -> HasAllKeysJsonb<Self, T>
fn has_all_keys<T>(self, other: T) -> HasAllKeysJsonb<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
?& expression. Read moreSource§fn contains<T>(self, other: T) -> Contains<Self, T>
fn contains<T>(self, other: T) -> Contains<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
@> expression. Read moreSource§fn is_contained_by<T>(self, other: T) -> IsContainedBy<Self, T>
fn is_contained_by<T>(self, other: T) -> IsContainedBy<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
<@ expression. Read moreSource§fn remove<T>(
self,
other: T,
) -> RemoveFromJsonb<Self, T::Expression, <T::Expression as Expression>::SqlType>
fn remove<T>( self, other: T, ) -> RemoveFromJsonb<Self, T::Expression, <T::Expression as Expression>::SqlType>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
- expression. Read moreSource§fn remove_by_path<T>(
self,
other: T,
) -> RemoveByPathFromJsonb<Self, T::Expression>
fn remove_by_path<T>( self, other: T, ) -> RemoveByPathFromJsonb<Self, T::Expression>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
#- expression. Read moreSource§impl<T> PgNetExpressionMethods for T
impl<T> PgNetExpressionMethods for T
Source§fn contains<T>(self, other: T) -> ContainsNet<Self, T>where
T: AsExpression<Inet>,
fn contains<T>(self, other: T) -> ContainsNet<Self, T>where
T: AsExpression<Inet>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
>> expression. Read moreSource§fn contains_or_eq<T>(self, other: T) -> ContainsNetLoose<Self, T>where
T: AsExpression<Inet>,
fn contains_or_eq<T>(self, other: T) -> ContainsNetLoose<Self, T>where
T: AsExpression<Inet>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
>>= expression. Read moreSource§fn is_contained_by<T>(self, other: T) -> IsContainedByNet<Self, T>where
T: AsExpression<Inet>,
fn is_contained_by<T>(self, other: T) -> IsContainedByNet<Self, T>where
T: AsExpression<Inet>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
<< expression. Read moreSource§fn is_contained_by_or_eq<T>(self, other: T) -> IsContainedByNetLoose<Self, T>where
T: AsExpression<Inet>,
fn is_contained_by_or_eq<T>(self, other: T) -> IsContainedByNetLoose<Self, T>where
T: AsExpression<Inet>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL `<<= expression. Read more
Source§fn overlaps_with<T>(self, other: T) -> OverlapsWithNet<Self, T>where
T: AsExpression<Inet>,
fn overlaps_with<T>(self, other: T) -> OverlapsWithNet<Self, T>where
T: AsExpression<Inet>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
&& expression. Read moreSource§fn and<T>(self, other: T) -> AndNet<Self, T>where
T: AsExpression<Inet>,
fn and<T>(self, other: T) -> AndNet<Self, T>where
T: AsExpression<Inet>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
& expression. Read moreSource§fn or<T>(self, other: T) -> OrNet<Self, T>where
T: AsExpression<Inet>,
fn or<T>(self, other: T) -> OrNet<Self, T>where
T: AsExpression<Inet>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
| expression. Read moreSource§fn diff<T>(self, other: T) -> DifferenceNet<Self, T>where
T: AsExpression<Inet>,
fn diff<T>(self, other: T) -> DifferenceNet<Self, T>where
T: AsExpression<Inet>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
- expression. Read moreSource§impl<T> PgRangeExpressionMethods for T
impl<T> PgRangeExpressionMethods for T
Source§fn contains<T>(self, other: T) -> RangeContains<Self, T>where
Self::SqlType: RangeOrMultirange,
<Self::SqlType as RangeOrMultirange>::Inner: SqlType + TypedExpressionType,
T: AsExpression<<Self::SqlType as RangeOrMultirange>::Inner>,
fn contains<T>(self, other: T) -> RangeContains<Self, T>where
Self::SqlType: RangeOrMultirange,
<Self::SqlType as RangeOrMultirange>::Inner: SqlType + TypedExpressionType,
T: AsExpression<<Self::SqlType as RangeOrMultirange>::Inner>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
@> expression. Read moreSource§fn contains_range<T>(self, other: T) -> ContainsRange<Self, T>
fn contains_range<T>(self, other: T) -> ContainsRange<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
@> expression. Read moreSource§fn is_contained_by<T>(self, other: T) -> IsContainedBy<Self, T>
fn is_contained_by<T>(self, other: T) -> IsContainedBy<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
<@ expression. Read moreSource§fn overlaps_with<T>(self, other: T) -> OverlapsWith<Self, T>
fn overlaps_with<T>(self, other: T) -> OverlapsWith<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
&& expression. Read moreSource§fn range_extends_right_to<T>(self, other: T) -> RangeExtendsRightTo<Self, T>
fn range_extends_right_to<T>(self, other: T) -> RangeExtendsRightTo<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
&< expression. Read moreSource§fn range_extends_left_to<T>(self, other: T) -> RangeExtendsLeftTo<Self, T>
fn range_extends_left_to<T>(self, other: T) -> RangeExtendsLeftTo<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
&> expression. Read moreSource§fn lesser_than<T>(self, other: T) -> LesserThanRange<Self, T>
fn lesser_than<T>(self, other: T) -> LesserThanRange<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
<< expression. Read moreSource§fn greater_than<T>(self, other: T) -> GreaterThanRange<Self, T>
fn greater_than<T>(self, other: T) -> GreaterThanRange<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
>> expression. Read moreSource§fn range_adjacent<T>(self, other: T) -> RangeAdjacent<Self, T>
fn range_adjacent<T>(self, other: T) -> RangeAdjacent<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
-|- expression. Read moreSource§fn union_range<T>(self, other: T) -> UnionRange<Self, T>
fn union_range<T>(self, other: T) -> UnionRange<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
+ expression. Read moreSource§fn difference_range<T>(self, other: T) -> Difference<Self, T>
fn difference_range<T>(self, other: T) -> Difference<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
- expression. Read moreSource§fn intersection_range<T>(self, other: T) -> Intersection<Self, T>
fn intersection_range<T>(self, other: T) -> Intersection<Self, T>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
* expression. Read moreSource§impl<T> PgTextExpressionMethods for T
impl<T> PgTextExpressionMethods for T
Source§fn ilike<T>(self, other: T) -> ILike<Self, T>where
T: AsExpression<Text>,
fn ilike<T>(self, other: T) -> ILike<Self, T>where
T: AsExpression<Text>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
ILIKE expression Read moreSource§fn not_ilike<T>(self, other: T) -> NotILike<Self, T>where
T: AsExpression<Text>,
fn not_ilike<T>(self, other: T) -> NotILike<Self, T>where
T: AsExpression<Text>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
NOT ILIKE expression Read moreSource§fn similar_to<T>(self, other: T) -> SimilarTo<Self, T>where
T: AsExpression<Text>,
fn similar_to<T>(self, other: T) -> SimilarTo<Self, T>where
T: AsExpression<Text>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
SIMILAR TO expression Read moreSource§fn not_similar_to<T>(self, other: T) -> NotSimilarTo<Self, T>where
T: AsExpression<Text>,
fn not_similar_to<T>(self, other: T) -> NotSimilarTo<Self, T>where
T: AsExpression<Text>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL
NOT SIMILAR TO expression Read moreSource§fn is_json(self) -> IsJson<Self>
fn is_json(self) -> IsJson<Self>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS JSON expression.
Requires PostgreSQL>=16 Read moreSource§fn is_not_json(self) -> IsNotJson<Self>
fn is_not_json(self) -> IsNotJson<Self>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS NOT JSON expression.
Requires PostgreSQL>=16 Read moreSource§fn is_json_object(self) -> IsJsonObject<Self>
fn is_json_object(self) -> IsJsonObject<Self>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS JSON OBJECT expression.
Requires PostgreSQL>=16 Read moreSource§fn is_not_json_object(self) -> IsNotJsonObject<Self>
fn is_not_json_object(self) -> IsNotJsonObject<Self>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS NOT JSON OBJECT expression.
Requires PostgreSQL>=16 Read moreSource§fn is_json_array(self) -> IsJsonArray<Self>
fn is_json_array(self) -> IsJsonArray<Self>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS JSON ARRAY expression.
Requires PostgreSQL>=16 Read moreSource§fn is_not_json_array(self) -> IsNotJsonArray<Self>
fn is_not_json_array(self) -> IsNotJsonArray<Self>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS NOT JSON ARRAY expression.
Requires PostgreSQL>=16 Read moreSource§fn is_json_scalar(self) -> IsJsonScalar<Self>
fn is_json_scalar(self) -> IsJsonScalar<Self>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS JSON SCALAR expression.
Requires PostgreSQL>=16 Read moreSource§fn is_not_json_scalar(self) -> IsNotJsonScalar<Self>
fn is_not_json_scalar(self) -> IsNotJsonScalar<Self>
Available on crate feature
postgres_backend only.Creates a PostgreSQL
IS NOT JSON SCALAR expression.
Requires PostgreSQL>=16 Read moreSource§impl<T> PgTimestampExpressionMethods for T
impl<T> PgTimestampExpressionMethods for T
Source§fn at_time_zone<T>(self, timezone: T) -> AtTimeZone<Self, T>where
T: AsExpression<VarChar>,
fn at_time_zone<T>(self, timezone: T) -> AtTimeZone<Self, T>where
T: AsExpression<VarChar>,
Available on crate feature
postgres_backend only.Creates a PostgreSQL “AT TIME ZONE” expression. Read more
Source§impl<E> PreferredBoolSqlType for E
impl<E> PreferredBoolSqlType for E
Source§type PreferredSqlType = <E as Expression>::SqlType
type PreferredSqlType = <E as Expression>::SqlType
The preferred
Bool SQL type for this AsExpression implementation. Read moreSource§impl<T, DB> QueryFragmentForCachedStatement<DB> for T
impl<T, DB> QueryFragmentForCachedStatement<DB> for T
Source§impl<T, Conn> RunQueryDsl<Conn> for Twhere
T: RunQueryDslSupport,
impl<T, Conn> RunQueryDsl<Conn> for Twhere
T: RunQueryDslSupport,
Source§fn execute(self, conn: &mut Conn) -> QueryResult<usize>where
Conn: Connection,
Self: ExecuteDsl<Conn>,
fn execute(self, conn: &mut Conn) -> QueryResult<usize>where
Conn: Connection,
Self: ExecuteDsl<Conn>,
Executes the given command, returning the number of rows affected. Read more
Source§fn load<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>where
Self: LoadQuery<'query, Conn, U>,
fn load<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>where
Self: LoadQuery<'query, Conn, U>,
Source§fn load_iter<'conn, 'query: 'conn, U, B>(
self,
conn: &'conn mut Conn,
) -> QueryResult<Self::RowIter<'conn>>where
U: 'conn,
Self: LoadQuery<'query, Conn, U, B> + 'conn,
fn load_iter<'conn, 'query: 'conn, U, B>(
self,
conn: &'conn mut Conn,
) -> QueryResult<Self::RowIter<'conn>>where
U: 'conn,
Self: LoadQuery<'query, Conn, U, B> + 'conn,
Source§fn get_result<'query, U>(self, conn: &mut Conn) -> QueryResult<U>where
Self: LoadQuery<'query, Conn, U>,
fn get_result<'query, U>(self, conn: &mut Conn) -> QueryResult<U>where
Self: LoadQuery<'query, Conn, U>,
Runs the command, and returns the affected row. Read more
Source§fn get_results<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>where
Self: LoadQuery<'query, Conn, U>,
fn get_results<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>where
Self: LoadQuery<'query, Conn, U>,
Runs the command, returning an
Vec with the affected rows. Read moreSource§impl<T> SqliteAnyJsonExpressionMethods for T
impl<T> SqliteAnyJsonExpressionMethods for T
Source§fn retrieve_as_object_sqlite<T>(
self,
other: T,
) -> RetrieveAsObjectSqlite<Self, T>
fn retrieve_as_object_sqlite<T>( self, other: T, ) -> RetrieveAsObjectSqlite<Self, T>
Available on crate feature
__sqlite-shared only.Creates a SQLite
-> expression. Read moreSource§impl<T> SqliteExpressionMethods for Twhere
T: Expression,
impl<T> SqliteExpressionMethods for Twhere
T: Expression,
Source§impl<T> TextExpressionMethods for T
impl<T> TextExpressionMethods for T
Source§fn concat<T>(self, other: T) -> Concat<Self, T>
fn concat<T>(self, other: T) -> Concat<Self, T>
Concatenates two strings using the
|| operator. Read moreSource§fn collate<C>(self, collation: C) -> Collate<Self, C>where
C: Collation,
fn collate<C>(self, collation: C) -> Collate<Self, C>where
C: Collation,
Returns a SQL
COLLATE expression. Read moreSource§impl<T> UntypedExpressionMethods for Twhere
T: Expression<SqlType = Untyped>,
impl<T> UntypedExpressionMethods for Twhere
T: Expression<SqlType = Untyped>,
Source§impl<T> WindowExpressionMethods for T
impl<T> WindowExpressionMethods for T
Source§fn over(self) -> Over<Self>where
Self: OverDsl,
fn over(self) -> Over<Self>where
Self: OverDsl,
Turn a function call into a window function call Read more
Source§fn window_filter<P>(self, f: P) -> WindowFilter<Self, P>
fn window_filter<P>(self, f: P) -> WindowFilter<Self, P>
Add a filter to the current window function Read more
Source§fn partition_by<E>(self, expr: E) -> PartitionBy<Self, E>where
Self: PartitionByDsl<E>,
fn partition_by<E>(self, expr: E) -> PartitionBy<Self, E>where
Self: PartitionByDsl<E>,
Add a partition clause to the current window function Read more
Source§fn window_order<E>(self, expr: E) -> WindowOrder<Self, E>where
Self: OrderWindowDsl<E>,
fn window_order<E>(self, expr: E) -> WindowOrder<Self, E>where
Self: OrderWindowDsl<E>,
Add a order clause to the current window function Read more