Struct sea_orm::MockDatabaseConnection
source · [−]pub struct MockDatabaseConnection { /* private fields */ }
Expand description
Defines a connection for the MockDatabase
Implementations
sourceimpl MockDatabaseConnection
impl MockDatabaseConnection
sourcepub fn new<M: 'static>(m: M) -> Self where
M: MockDatabaseTrait,
pub fn new<M: 'static>(m: M) -> Self where
M: MockDatabaseTrait,
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more