Trait sea_orm::ConnectionTrait
source · pub trait ConnectionTrait: Sync {
fn get_database_backend(&self) -> DbBackend;
fn execute<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<ExecResult, DbErr>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn query_one<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<Option<QueryResult>, DbErr>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn query_all<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<Vec<QueryResult>, DbErr>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn support_returning(&self) -> bool { ... }
fn is_mock_connection(&self) -> bool { ... }
}
Expand description
Creates constraints for any structure that can create a database connection and execute SQL statements
Required Methods
sourcefn get_database_backend(&self) -> DbBackend
fn get_database_backend(&self) -> DbBackend
Fetch the database backend as specified in DbBackend. This depends on feature flags enabled.
sourcefn execute<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<ExecResult, DbErr>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
stmt: Statement
) -> Pin<Box<dyn Future<Output = Result<ExecResult, DbErr>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Execute a Statement
Provided Methods
sourcefn support_returning(&self) -> bool
fn support_returning(&self) -> bool
Check if the connection supports RETURNING
syntax on insert and update
sourcefn is_mock_connection(&self) -> bool
fn is_mock_connection(&self) -> bool
Check if the connection is a test connection for the Mock database