Skip to content

Commit a7d2703

Browse files
authored
Add additional info regarding using Transaction and PoolConnection as Executor (#2713)
Copy-paste from https://github.com/launchbadge/sqlx/blob/main/CHANGELOG.md#070---2023-06-30
1 parent ab0d10d commit a7d2703

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sqlx-core/src/executor.rs

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ use std::fmt::Debug;
2222
/// * [`&Pool`](super::pool::Pool)
2323
/// * [`&mut Connection`](super::connection::Connection)
2424
///
25+
/// The [`Executor`](crate::Executor) impls for [`Transaction`](crate::Transaction)
26+
/// and [`PoolConnection`](crate::pool::PoolConnection) have been deleted because they
27+
/// cannot exist in the new crate architecture without rewriting the Executor trait entirely.
28+
/// To fix this breakage, simply add a dereference where an impl [`Executor`](crate::Executor) is expected, as
29+
/// they both dereference to the inner connection type which will still implement it:
30+
/// * `&mut transaction` -> `&mut *transaction`
31+
/// * `&mut connection` -> `&mut *connection`
32+
///
2533
pub trait Executor<'c>: Send + Debug + Sized {
2634
type Database: Database;
2735

0 commit comments

Comments
 (0)