-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat(postgres): Adding a postgres async pool to make the db interactions asynchronous #1779
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
75e8f0b
feat(common): added postgress async pool wrapper
5c8a19d
Simplification of the code a little and starting new bare unit tests
Ivansete-status e7c4e60
Moving all postgres logic to 'waku/v2/waku_archive/driver/postgres_dr…
Ivansete-status 3a6b4d9
Integrating postgres asynchronous calls into the current implementation
Ivansete-status 6f3c9f6
better use 'proc' instead of 'method'
Ivansete-status 92f9af2
test_driver_postgres.nim: use of future 'discard' instead of 'let _'
Ivansete-status 9df5b93
asyncpool.nim: Make import more explicit to indicate the actual modul…
Ivansete-status d2884a2
asyncpool.nim: making explicit num params in prepared statement
Ivansete-status 0b4b13f
postgres_driver/connection: better spacing style
Ivansete-status 2f52cbf
postgres_driver.nim, asyncpool.nim: better error handling
Ivansete-status File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{.used.} | ||
|
||
import | ||
std/[strutils, os], | ||
stew/results, | ||
testutils/unittests, | ||
chronos | ||
import | ||
../../waku/common/postgres/asyncpool, | ||
../../waku/common/postgres/pg_asyncpool_opts | ||
|
||
suite "Async pool": | ||
|
||
asyncTest "Create connection pool": | ||
## TODO: extend unit tests | ||
var pgOpts = PgAsyncPoolOptions.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe we should follow this pattern in other test files too so we can see why the result is an error!
non-blocker
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, I'll set a separate PR asap with this
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.
Morning @rymnc ! After checking the code to apply this change I see that the change would be quite wide but we won't get very great investment return by doing so, as the tests don't tend to fail very often.
Therefore, I think is better to just apply this technique from now on in the upcoming tests.
Of course, if you consider it worth the effort, then I will make it for the current tests :)