Struct diesel::expression::UncheckedBind [−][src]
pub struct UncheckedBind<Query, Value> { /* fields omitted */ }
Expand description
Returned by the SqlLiteral::bind()
method when binding a value to a fragment of SQL.
Implementations
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("id > ")
.bind::<Integer,_>(1)
.sql(" AND name <> 'Ryan'")
)
.get_results(&connection);
let expected = vec!["Tess".to_string()];
assert_eq!(Ok(expected), query);
Trait Implementations
impl<Query, Value, DB> QueryFragment<DB> for UncheckedBind<Query, Value> where
DB: Backend,
Query: QueryFragment<DB>,
Value: QueryFragment<DB>,
impl<Query, Value, DB> QueryFragment<DB> for UncheckedBind<Query, Value> where
DB: Backend,
Query: QueryFragment<DB>,
Value: QueryFragment<DB>,
Walk over this QueryFragment
for all passes. Read more
Converts this QueryFragment
to its SQL representation. Read more
fn collect_binds(
&self,
out: &mut DB::BindCollector,
metadata_lookup: &DB::MetadataLookup
) -> QueryResult<()>
fn collect_binds(
&self,
out: &mut DB::BindCollector,
metadata_lookup: &DB::MetadataLookup
) -> QueryResult<()>
Serializes all bind parameters in this query. Read more
Is this query safe to store in the prepared statement cache? Read more
fn execute(self, conn: &Conn) -> QueryResult<usize> where
Conn: Connection,
Self: ExecuteDsl<Conn>,
fn execute(self, conn: &Conn) -> QueryResult<usize> where
Conn: Connection,
Self: ExecuteDsl<Conn>,
Executes the given command, returning the number of rows affected. Read more
Executes the given query, returning a Vec
with the returned rows. Read more
Runs the command, and returns the affected row. Read more
Runs the command, returning an Vec
with the affected rows. Read more
impl<QS, Query, Value> AppearsOnTable<QS> for UncheckedBind<Query, Value> where
Self: Expression,
impl<QS, Query, Value> SelectableExpression<QS> for UncheckedBind<Query, Value> where
Self: AppearsOnTable<QS>,
Auto Trait Implementations
impl<Query, Value> RefUnwindSafe for UncheckedBind<Query, Value> where
Query: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Query, Value> Send for UncheckedBind<Query, Value> where
Query: Send,
Value: Send,
impl<Query, Value> Sync for UncheckedBind<Query, Value> where
Query: Sync,
Value: Sync,
impl<Query, Value> Unpin for UncheckedBind<Query, Value> where
Query: Unpin,
Value: Unpin,
impl<Query, Value> UnwindSafe for UncheckedBind<Query, Value> where
Query: UnwindSafe,
Value: UnwindSafe,
Blanket Implementations
type Expression = T
type Expression = T
The expression being returned
Perform the conversion
type Query = T
type Query = T
What kind of query does this type represent?
Mutably borrows from an owned value. Read more
impl<Conn, DB, T> ExecuteDsl<Conn, DB> for T where
DB: Backend,
T: QueryFragment<DB> + QueryId,
Conn: Connection<Backend = DB>,
impl<Conn, DB, T> ExecuteDsl<Conn, DB> for T where
DB: Backend,
T: QueryFragment<DB> + QueryId,
Conn: Connection<Backend = DB>,
Convert self
to an expression for Diesel’s query builder. Read more