Struct sea_orm::MockDatabaseConnection
source · pub struct MockDatabaseConnection { /* private fields */ }
Expand description
Defines a connection for the MockDatabase
Implementations§
source§impl MockDatabaseConnection
impl MockDatabaseConnection
sourcepub fn new<M>(m: M) -> Selfwhere
M: MockDatabaseTrait + 'static,
pub fn new<M>(m: M) -> Selfwhere
M: MockDatabaseTrait + 'static,
Create a connection to the MockDatabase
sourcepub fn get_database_backend(&self) -> DbBackend
pub fn get_database_backend(&self) -> DbBackend
Get the DatabaseBackend being used by the MockDatabase
sourcepub fn execute(&self, statement: Statement) -> Result<ExecResult, DbErr>
pub fn execute(&self, statement: Statement) -> Result<ExecResult, DbErr>
Execute the SQL statement in the MockDatabase
sourcepub fn query_one(
&self,
statement: Statement
) -> Result<Option<QueryResult>, DbErr>
pub fn query_one( &self, statement: Statement ) -> Result<Option<QueryResult>, DbErr>
Return one QueryResult if the query was successful
sourcepub fn query_all(&self, statement: Statement) -> Result<Vec<QueryResult>, DbErr>
pub fn query_all(&self, statement: Statement) -> Result<Vec<QueryResult>, DbErr>
Return all QueryResults if the query was successful
sourcepub fn fetch(
&self,
statement: &Statement
) -> Pin<Box<dyn Stream<Item = Result<QueryResult, DbErr>> + Send>>
pub fn fetch( &self, statement: &Statement ) -> Pin<Box<dyn Stream<Item = Result<QueryResult, DbErr>> + Send>>
Return QueryResults from a multi-query operation
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MockDatabaseConnection
impl Send for MockDatabaseConnection
impl Sync for MockDatabaseConnection
impl Unpin for MockDatabaseConnection
impl UnwindSafe for MockDatabaseConnection
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