Enum sea_orm::DatabaseConnection [−][src]
pub enum DatabaseConnection {
SqlxMySqlPoolConnection(SqlxMySqlPoolConnection),
SqlxPostgresPoolConnection(SqlxPostgresPoolConnection),
SqlxSqlitePoolConnection(SqlxSqlitePoolConnection),
MockDatabaseConnection(Arc<MockDatabaseConnection>),
Disconnected,
}
Expand description
Handle a database connection depending on the backend enabled by the feature flags. This creates a database pool.
Variants
SqlxMySqlPoolConnection(SqlxMySqlPoolConnection)
Tuple Fields
Create a MYSQL database connection and pool
SqlxPostgresPoolConnection(SqlxPostgresPoolConnection)
Tuple Fields
Create a PostgreSQL database connection and pool
SqlxSqlitePoolConnection(SqlxSqlitePoolConnection)
Tuple Fields
Create a SQLite database connection and pool
MockDatabaseConnection(Arc<MockDatabaseConnection>)
Tuple Fields
Create a Mock database connection useful for testing
Disconnected
The connection to the database has been severed
Implementations
Generate a database connection for testing the Mock database
pub fn into_transaction_log(self) -> Vec<Transaction>ⓘ
pub fn into_transaction_log(self) -> Vec<Transaction>ⓘ
Get the transaction log as a collection Vec<crate::Transaction>
Trait Implementations
fn transaction<'life0, 'async_trait, F, T, E>(
&'life0 self,
_callback: F
) -> Pin<Box<dyn Future<Output = Result<T, TransactionError<E>>> + Send + 'async_trait>> where
F: for<'c> FnOnce(&'c DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'c>> + Send,
T: Send,
E: Error + Send,
F: 'async_trait,
T: 'async_trait,
E: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn transaction<'life0, 'async_trait, F, T, E>(
&'life0 self,
_callback: F
) -> Pin<Box<dyn Future<Output = Result<T, TransactionError<E>>> + Send + 'async_trait>> where
F: for<'c> FnOnce(&'c DatabaseTransaction) -> Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'c>> + Send,
T: Send,
E: Error + Send,
F: 'async_trait,
T: 'async_trait,
E: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Execute the function inside a transaction. If the function returns an error, the transaction will be rolled back. If it does not return an error, the transaction will be committed.
type Stream = QueryStream
type Stream = QueryStream
Create a stream for the QueryResult
Execute a Statement
Execute a Statement and return a query
Execute a Statement and return a collection Vec<QueryResult> on success
Execute a Statement and return a stream of results
Execute SQL BEGIN
transaction.
Returns a Transaction that can be committed or rolled back Read more
Check if the connection is a test connection for the Mock database
Check if the connection supports RETURNING
syntax on insert and update
Auto Trait Implementations
impl !RefUnwindSafe for DatabaseConnection
impl Send for DatabaseConnection
impl Sync for DatabaseConnection
impl Unpin for DatabaseConnection
impl !UnwindSafe for DatabaseConnection
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more