-
Hi guys, I'm experimenting now with the latest alpha and it seems that Executor implementation for Transaction is disabled at the moment. Is there any other way to execute query on transaction or should I wait until this is fixed? |
Beta Was this translation helpful? Give feedback.
Answered by
HaronK
Jul 21, 2023
Replies: 2 comments 1 reply
-
Is this the same problem? I cannot make querying with a transaction work no matter what I try. pub async fn insert_product(product: &Product, pool: &sqlx::PgPool) -> Result<()> {
let mut tx = pool.begin().await?;
sqlx::query!(
r#"
INSERT INTO product (name, url) VALUES ($1, $2)
"#,
product.name,
product.url,
)
.execute(&tx)
.await?;
// ...
|
Beta Was this translation helpful? Give feedback.
1 reply
-
In version 0.7.0 you have to use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
HaronK
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In version 0.7.0 you have to use
&mut *tx
to get an executor. There was a comment in 0.7.0 release notes about that.