[−][src]Struct sqlx::Query
Raw SQL query with bind parameters. Returned by query
.
Methods
impl<'q, DB> Query<'q, DB> where
DB: Database,
[src]
DB: Database,
pub fn bind<T>(self, value: T) -> Query<'q, DB> where
T: Type<DB> + Encode<DB>,
[src]
T: Type<DB> + Encode<DB>,
Bind a value for use with this SQL query.
If the number of times this is called does not match the number of bind parameters that
appear in the query (?
for most SQL flavors, $1 .. $N
for Postgres) then an error
will be returned when this query is executed.
There is no validation that the value is of the type expected by the query. Most SQL flavors will perform type coercion (Postgres will return a database error).s
impl<'q, DB> Query<'q, DB> where
DB: Database,
[src]
DB: Database,
pub fn map<F, O>(self, mapper: F) -> Map<'q, DB, impl TryMapRow<DB, Output = O>> where
F: MapRow<DB, Output = O>,
O: Unpin,
[src]
F: MapRow<DB, Output = O>,
O: Unpin,
Map each row in the result to another type.
The returned type has most of the same methods but does not have
.execute()
or `.bind().
See also: [query_as][crate::query_as::query_as].
pub fn try_map<F>(self, mapper: F) -> Map<'q, DB, F> where
F: TryMapRow<DB>,
[src]
F: TryMapRow<DB>,
Map each row in the result to another type.
See also: [query_as][crate::query_as::query_as].
impl<'q, DB> Query<'q, DB> where
DB: Database,
Query<'q, DB>: Execute<'q, DB>,
[src]
DB: Database,
Query<'q, DB>: Execute<'q, DB>,
pub async fn execute<E>(self, __arg1: E) -> Result<u64, Error> where
E: Executor<Database = DB>,
[src]
E: Executor<Database = DB>,
pub fn fetch<'e, E>(self, executor: E) -> <DB as HasCursor<'e, 'q>>::Cursor where
E: RefExecutor<'e, Database = DB>,
[src]
E: RefExecutor<'e, Database = DB>,
Trait Implementations
Auto Trait Implementations
impl<'q, DB> RefUnwindSafe for Query<'q, DB> where
DB: RefUnwindSafe,
<DB as Database>::Arguments: RefUnwindSafe,
DB: RefUnwindSafe,
<DB as Database>::Arguments: RefUnwindSafe,
impl<'q, DB> Send for Query<'q, DB> where
<DB as Database>::Arguments: Send,
<DB as Database>::Arguments: Send,
impl<'q, DB> Sync for Query<'q, DB> where
DB: Sync,
<DB as Database>::Arguments: Sync,
DB: Sync,
<DB as Database>::Arguments: Sync,
impl<'q, DB> Unpin for Query<'q, DB> where
DB: Unpin,
<DB as Database>::Arguments: Unpin,
DB: Unpin,
<DB as Database>::Arguments: Unpin,
impl<'q, DB> UnwindSafe for Query<'q, DB> where
DB: UnwindSafe,
<DB as Database>::Arguments: UnwindSafe,
DB: UnwindSafe,
<DB as Database>::Arguments: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,