-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contextualize database and separate in to modules #486
Conversation
fbf3bc3
to
cec608b
Compare
If you have the time, consider using this (I had written this earlier): macro_rules! execute_with_tx {
($conn:expr, $tx:expr, $query:expr, $method:ident) => {
match $tx {
Some(tx) => $query.$method(&mut **tx).await,
None => $query.$method(&$conn).await,
}
};
}
// later
execute_with_tx!(self.connection, tx, query, execute); |
Let me do this in a chain PR and not congest this PR, as there is already too many changes. |
* database: Add execute_query_with_tx macro. * database: Use execute_query_with_tx. * Update core/src/database/mod.rs Co-authored-by: Mehmet Efe Akça <[email protected]> --------- Co-authored-by: Mehmet Efe Akça <[email protected]>
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.
Thanks a lot for the changes, I think we'll improve in terms of documentation with these small changes
Let me make this changes in a chain PR again for an easier review experience. We should keep this PR clean from refactors/updates. I made a mistake merging the child PR #488. After every chain PR is approved, we can merge them one by one. If we don't do this, some changes will be missed by the reviewers. |
* database: Add the new DatabaseTransaction type. * database: Update comments and names of watchtower functions. * database: Update verifier func comments/names. * database: Update comments and add tests for operator. * database: Remove Option from DatabaseTransaction type. * database: Update header chain prover namings and docs.
Description
Separates database/common into different files based on the context.
This PR basically moves code to separate modules but it also removes
tracing::instrument
s (because they are useless) and adds some todos regarding to tests etc..Adds execute_query_with_tx macro that will simplify query execution.
Linked Issues