Trait diesel::prelude::LoadDsl
[−]
[src]
pub trait LoadDsl<Conn>: Sized { fn load<U>(self, conn: &Conn) -> QueryResult<Vec<U>>
where
Self: LoadQuery<Conn, U>, { ... } fn get_result<U>(self, conn: &Conn) -> QueryResult<U>
where
Self: LoadQuery<Conn, U>, { ... } fn get_results<U>(self, conn: &Conn) -> QueryResult<Vec<U>>
where
Self: LoadQuery<Conn, U>, { ... } }
Methods to execute a query given a connection. These are automatically implemented for the various query types.
Provided Methods
fn load<U>(self, conn: &Conn) -> QueryResult<Vec<U>> where
Self: LoadQuery<Conn, U>,
Self: LoadQuery<Conn, U>,
Executes the given query, returning a Vec
with the returned rows.
fn get_result<U>(self, conn: &Conn) -> QueryResult<U> where
Self: LoadQuery<Conn, U>,
Self: LoadQuery<Conn, U>,
Runs the command, and returns the affected row. Err(NotFound)
will be
returned if the query affected 0 rows. You can call .optional()
on the
result of this if the command was optional to get back a
Result<Option<U>>
fn get_results<U>(self, conn: &Conn) -> QueryResult<Vec<U>> where
Self: LoadQuery<Conn, U>,
Self: LoadQuery<Conn, U>,
Runs the command, returning an Vec
with the affected rows.
Implementors
impl<'a, T, U, Op, Ret, Conn> LoadDsl<Conn> for BatchInsertStatement<T, &'a [U], Op, Ret>
impl<Conn, T> LoadDsl<Conn> for T where
Conn: Connection,
Conn::Backend: HasSqlType<T::SqlType>,
T: AsQuery,
T::Query: QueryFragment<Conn::Backend> + QueryId,