MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / begin_with_config

Method begin_with_config

src/database/db_connection.rs:269–297  ·  view source on GitHub ↗
(
        &self,
        _isolation_level: Option<IsolationLevel>,
        _access_mode: Option<AccessMode>,
    )

Source from the content-addressed store, hash-verified

267
268 #[instrument(level = "trace")]
269 async fn begin_with_config(
270 &self,
271 _isolation_level: Option<IsolationLevel>,
272 _access_mode: Option<AccessMode>,
273 ) -> Result<DatabaseTransaction, DbErr> {
274 match self {
275 #[cfg(feature = "sqlx-mysql")]
276 DatabaseConnection::SqlxMySqlPoolConnection(conn) => {
277 conn.begin(_isolation_level, _access_mode).await
278 }
279 #[cfg(feature = "sqlx-postgres")]
280 DatabaseConnection::SqlxPostgresPoolConnection(conn) => {
281 conn.begin(_isolation_level, _access_mode).await
282 }
283 #[cfg(feature = "sqlx-sqlite")]
284 DatabaseConnection::SqlxSqlitePoolConnection(conn) => {
285 conn.begin(_isolation_level, _access_mode).await
286 }
287 #[cfg(feature = "mock")]
288 DatabaseConnection::MockDatabaseConnection(conn) => {
289 DatabaseTransaction::new_mock(Arc::clone(conn), None).await
290 }
291 #[cfg(feature = "proxy")]
292 DatabaseConnection::ProxyDatabaseConnection(conn) => {
293 DatabaseTransaction::new_proxy(conn.clone(), None).await
294 }
295 DatabaseConnection::Disconnected => Err(conn_err("Disconnected")),
296 }
297 }
298
299 /// Execute the function inside a transaction.
300 /// If the function returns an error, the transaction will be rolled back. If it does not return an error, the transaction will be committed.

Callers

nothing calls this directly

Calls 2

conn_errFunction · 0.85
beginMethod · 0.45

Tested by

no test coverage detected