diff --git a/sqlx-mysql/src/lib.rs b/sqlx-mysql/src/lib.rs index c35be3c6..7aa14256 100644 --- a/sqlx-mysql/src/lib.rs +++ b/sqlx-mysql/src/lib.rs @@ -60,6 +60,9 @@ pub type MySqlPoolOptions = crate::pool::PoolOptions; pub trait MySqlExecutor<'c>: Executor<'c, Database = MySql> {} impl<'c, T: Executor<'c, Database = MySql>> MySqlExecutor<'c> for T {} +/// An alias for [`Transaction`][crate::transaction::Transaction], specialized for MySQL. +pub type MySqlTransaction<'c> = crate::transaction::Transaction<'c, MySql>; + // NOTE: required due to the lack of lazy normalization impl_into_arguments_for_arguments!(MySqlArguments); impl_acquire!(MySql, MySqlConnection); diff --git a/sqlx-postgres/src/lib.rs b/sqlx-postgres/src/lib.rs index c50f5306..792f8bbd 100644 --- a/sqlx-postgres/src/lib.rs +++ b/sqlx-postgres/src/lib.rs @@ -70,6 +70,9 @@ pub type PgPoolOptions = crate::pool::PoolOptions; pub trait PgExecutor<'c>: Executor<'c, Database = Postgres> {} impl<'c, T: Executor<'c, Database = Postgres>> PgExecutor<'c> for T {} +/// An alias for [`Transaction`][crate::transaction::Transaction], specialized for Postgres. +pub type PgTransaction<'c> = crate::transaction::Transaction<'c, Postgres>; + impl_into_arguments_for_arguments!(PgArguments); impl_acquire!(Postgres, PgConnection); impl_column_index_for_row!(PgRow); diff --git a/sqlx-sqlite/src/lib.rs b/sqlx-sqlite/src/lib.rs index f8f55348..3bcb6d14 100644 --- a/sqlx-sqlite/src/lib.rs +++ b/sqlx-sqlite/src/lib.rs @@ -105,6 +105,9 @@ pub type SqlitePoolOptions = crate::pool::PoolOptions; pub trait SqliteExecutor<'c>: Executor<'c, Database = Sqlite> {} impl<'c, T: Executor<'c, Database = Sqlite>> SqliteExecutor<'c> for T {} +/// An alias for [`Transaction`][sqlx_core::transaction::Transaction], specialized for SQLite. +pub type SqliteTransaction<'c> = sqlx_core::transaction::Transaction<'c, Sqlite>; + // NOTE: required due to the lack of lazy normalization impl_into_arguments_for_arguments!(SqliteArguments<'q>); impl_column_index_for_row!(SqliteRow); diff --git a/src/lib.rs b/src/lib.rs index a9e90c07..870fa703 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,17 +37,23 @@ pub use sqlx_core::migrate; #[cfg(feature = "mysql")] #[cfg_attr(docsrs, doc(cfg(feature = "mysql")))] #[doc(inline)] -pub use sqlx_mysql::{self as mysql, MySql, MySqlConnection, MySqlExecutor, MySqlPool}; +pub use sqlx_mysql::{ + self as mysql, MySql, MySqlConnection, MySqlExecutor, MySqlPool, MySqlTransaction, +}; #[cfg(feature = "postgres")] #[cfg_attr(docsrs, doc(cfg(feature = "postgres")))] #[doc(inline)] -pub use sqlx_postgres::{self as postgres, PgConnection, PgExecutor, PgPool, Postgres}; +pub use sqlx_postgres::{ + self as postgres, PgConnection, PgExecutor, PgPool, PgTransaction, Postgres, +}; #[cfg(feature = "_sqlite")] #[cfg_attr(docsrs, doc(cfg(feature = "_sqlite")))] #[doc(inline)] -pub use sqlx_sqlite::{self as sqlite, Sqlite, SqliteConnection, SqliteExecutor, SqlitePool}; +pub use sqlx_sqlite::{ + self as sqlite, Sqlite, SqliteConnection, SqliteExecutor, SqlitePool, SqliteTransaction, +}; #[cfg(feature = "any")] #[cfg_attr(docsrs, doc(cfg(feature = "any")))]