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

Method begin

src/database/db_connection.rs:248–266  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

246impl TransactionTrait for DatabaseConnection {
247 #[instrument(level = "trace")]
248 async fn begin(&self) -> Result<DatabaseTransaction, DbErr> {
249 match self {
250 #[cfg(feature = "sqlx-mysql")]
251 DatabaseConnection::SqlxMySqlPoolConnection(conn) => conn.begin(None, None).await,
252 #[cfg(feature = "sqlx-postgres")]
253 DatabaseConnection::SqlxPostgresPoolConnection(conn) => conn.begin(None, None).await,
254 #[cfg(feature = "sqlx-sqlite")]
255 DatabaseConnection::SqlxSqlitePoolConnection(conn) => conn.begin(None, None).await,
256 #[cfg(feature = "mock")]
257 DatabaseConnection::MockDatabaseConnection(conn) => {
258 DatabaseTransaction::new_mock(Arc::clone(conn), None).await
259 }
260 #[cfg(feature = "proxy")]
261 DatabaseConnection::ProxyDatabaseConnection(conn) => {
262 DatabaseTransaction::new_proxy(conn.clone(), None).await
263 }
264 DatabaseConnection::Disconnected => Err(conn_err("Disconnected")),
265 }
266 }
267
268 #[instrument(level = "trace")]
269 async fn begin_with_config(

Callers 1

begin_with_configMethod · 0.45

Calls 1

conn_errFunction · 0.85

Tested by

no test coverage detected