Struct microrm::query::QueryInterface
source · pub struct QueryInterface<'l> { /* private fields */ }
Expand description
The query interface for a database.
As the query interface provides some level of caching, try to strive for as much sharing as
possible. Passing around QueryInterface
references instead of DB
references is a good way
to achieve this. However, QueryInterface
is explicitly !Send
, so you may need to use
something like a DBPool
to acquire instances locally if you’re using
threads or asynchronous programming.
Implementations§
source§impl<'l> QueryInterface<'l>
impl<'l> QueryInterface<'l>
source§impl<'l> QueryInterface<'l>
impl<'l> QueryInterface<'l>
source§impl<'l> QueryInterface<'l>
impl<'l> QueryInterface<'l>
sourcepub fn get<'a, 'b, T: Entity>(&'a self) -> Select<'b, 'l, T>where
'a: 'b,
pub fn get<'a, 'b, T: Entity>(&'a self) -> Select<'b, 'l, T>where
'a: 'b,
Get an entity from its table, aka perform a SELECT
query.
Auto Trait Implementations§
impl<'l> !RefUnwindSafe for QueryInterface<'l>
impl<'l> !Send for QueryInterface<'l>
impl<'l> !Sync for QueryInterface<'l>
impl<'l> Unpin for QueryInterface<'l>
impl<'l> !UnwindSafe for QueryInterface<'l>
Blanket Implementations§
source§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