-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
…h to that now that there is no separate Actix-web feature any more
…rently that leads to >100 compilation errors that hopefully disappear when same change applied there as well
…qlx now uses a directory called .sqlx
7736c4b
to
cb21c7b
Compare
cb21c7b
to
6f87e54
Compare
…ng why test case fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats and thanks a lot. Let's set a new version for the server in this PR in order to deploy it soon.
Ok(match connection { | ||
Connection::Pool(pool) => fetch(path, instance, pool).await?, | ||
Connection::Transaction(transaction) => { | ||
fetch_via_transaction(path, instance, transaction).await? | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to not have those lines any more :-)
.await? | ||
.map(|result| result.uuid_id as i32) | ||
.ok_or(operation::Error::NotFoundError)? | ||
} | ||
}; | ||
|
||
let uuid = Uuid::fetch_via_transaction(id, &mut transaction).await?; | ||
let uuid = Uuid::fetch_via_transaction(id, &mut *transaction).await?; | ||
|
||
transaction.commit().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't hurt either? Might be also faster since there is no rollback in the mysql...
/// let events = sqlx::query!(r#"SELECT id FROM event_log"#).fetch_all(&mut transaction).await?; | ||
/// let users = sqlx::query!(r#"SELECT id FROM user"#).fetch_all(&mut transaction).await?; | ||
/// let events = sqlx::query!(r#"SELECT id FROM event_log"#).fetch_all(&mut *transaction).await?; | ||
/// let users = sqlx::query!(r#"SELECT id FROM user"#).fetch_all(&mut *transaction).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this file?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because I have not entirely removed its usage yet, only where it was necessary to make database-layer compile again.
@AndreasHuber Can you do this in another PR? |
This PR includes:
Things to look out for when reviewing:
If you wonder how nested transactions work, check https://github.com/launchbadge/sqlx/blob/c70cfaf035b3ffcb1d6f244f6070e92646e83515/sqlx-core/src/transaction.rs#L242C1-L268C2.
Things that could make sense but are excluded here because the PR is already big:
Related info: