pub trait LoadConnection<B = DefaultLoadingMode>: Connectionwhere
    for<'conn, 'query> Self: ConnectionGatWorkaround<'conn, 'query, Self::Backend, B>,{
    // Required method
    fn load<'conn, 'query, T>(
        &'conn mut self,
        source: T
    ) -> QueryResult<LoadRowIter<'conn, 'query, Self, Self::Backend, B>>
       where T: Query + QueryFragment<Self::Backend> + QueryId + 'query,
             Self::Backend: QueryMetadata<T::SqlType>;
}
Expand description

The specific part of a Connection which actually loads data from the database

This is a separate trait to allow connection implementations to specify different loading modes via the generic paramater.

Required Methods§

source

fn load<'conn, 'query, T>( &'conn mut self, source: T ) -> QueryResult<LoadRowIter<'conn, 'query, Self, Self::Backend, B>>where T: Query + QueryFragment<Self::Backend> + QueryId + 'query, Self::Backend: QueryMetadata<T::SqlType>,

Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.

Executes a given query and returns any requested values

This function executes a given query and returns the query result as given by the database. Normal users should not use this function. Use QueryDsl::load instead.

This function is useful for people trying to build an alternative dsl on top of diesel. It returns an LoadRowIter, which is essentially an Iterator<Item = QueryResult<&impl Row<Self::Backend>>. This type can be used to iterate over all rows returned by the database.

Implementors§

source§

impl LoadConnection<DefaultLoadingMode> for MysqlConnection

Available on crate features mysql and mysql_backend only.
source§

impl LoadConnection<DefaultLoadingMode> for SqliteConnection

Available on crate feature sqlite only.
source§

impl<B> LoadConnection<B> for PgConnectionwhere Self: PgLoadingMode<B>,

Available on crate features postgres and postgres_backend only.
source§

impl<B, M> LoadConnection<B> for PooledConnection<M>where M: ManageConnection, M::Connection: LoadConnection<B> + R2D2Connection,

Available on crate feature r2d2 only.