Skip to content
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

Move SqlStorage into shared Context #135

Merged
merged 3 commits into from
Jun 2, 2022

Conversation

adzialocha
Copy link
Member

@adzialocha adzialocha commented May 27, 2022

This moves the SqlStorage instance into the shared Context, so we don't need to create a new one on every GraphQL request (and other future methods).

Note: It is still possible to access the underlying connection pool object when needed as it is publicly exported inside the SqlStorage.

Closes: #134

📋 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

@adzialocha adzialocha requested review from cafca and sandreae May 27, 2022 16:35
* development:
  Make clippy happy
  We can't drop a reference
  Fix merge conflict
  Doc strings for entry and log store structs (#126)
  Improve CI, track test coverage (#139)
  Fix high CPU usage of idle workers (#136)
@codecov
Copy link

codecov bot commented May 31, 2022

Codecov Report

Merging #135 (66f0822) into development (24c68a1) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

@@               Coverage Diff               @@
##           development     #135      +/-   ##
===============================================
- Coverage        93.31%   93.25%   -0.07%     
===============================================
  Files               26       26              
  Lines             1421     1423       +2     
===============================================
+ Hits              1326     1327       +1     
- Misses              95       96       +1     
Impacted Files Coverage Δ
aquadoggo/src/node.rs 0.00% <ø> (ø)
aquadoggo/src/context.rs 100.00% <100.00%> (ø)
aquadoggo/src/db/provider.rs 87.50% <100.00%> (+1.78%) ⬆️
aquadoggo/src/graphql/client/mutation.rs 97.05% <100.00%> (-0.09%) ⬇️
aquadoggo/src/graphql/client/query.rs 93.75% <100.00%> (-0.19%) ⬇️
aquadoggo/src/graphql/schema.rs 100.00% <100.00%> (ø)
aquadoggo/src/server.rs 95.00% <100.00%> (ø)
aquadoggo/src/test_helpers.rs 85.71% <100.00%> (+1.09%) ⬆️
aquadoggo/src/materializer/worker.rs 88.09% <0.00%> (-0.48%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24c68a1...66f0822. Read the comment docs.

@adzialocha adzialocha merged commit 8c71aa1 into development Jun 2, 2022
@adzialocha adzialocha deleted the deduplicate-storage-provider branch June 2, 2022 11:53
Comment on lines +42 to +44
// Load and return next entry arguments
let store = ctx.data::<SqlStorage>()?;
store.get_entry_args(&args).await.map_err(Error::from)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better! 🌷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants