-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Added support for Mongo-like Sessions and Transactions #40
Merged
Conversation
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
… multiple database types
oskardudycz
force-pushed
the
sessions_and_transactions_support
branch
from
July 30, 2024 11:49
d7e84f9
to
4244779
Compare
oskardudycz
force-pushed
the
sessions_and_transactions_support
branch
2 times, most recently
from
August 1, 2024 13:49
f17bfaa
to
4be82fc
Compare
oskardudycz
force-pushed
the
sessions_and_transactions_support
branch
from
August 1, 2024 13:50
4be82fc
to
5b6372f
Compare
That should allow easier extension with other database types or drivers.
…ection Collection only needs sql execution, so there's no need to inject the whole pool. This will also make easier injecting other executors from session's transaction.
…ntion Renamed postgresCollection to pongoCollection, as it'll be generalised in the follow-up commit
Note: it's not yet used. That'll be added in the follow up commits.
oskardudycz
force-pushed
the
sessions_and_transactions_support
branch
from
August 3, 2024 10:03
3fb9bcb
to
1755469
Compare
Renamed also Transaction to DatabaseTransaction to make explicit that's related to database
That'll make easier extensions
oskardudycz
changed the title
Added initial types definition for Pongo Sessions and transactions
Added support for Mongo-like Sessions and Transactions
Aug 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As in the title, it added support for sessions and transactions. Unlike MongoDB, it only supports transactions on a single database (as we have PostgreSQL underneath).
To make that possible, a huge refactoring was made, introducing abstractions for Pool, Connection, and Transaction. This will enable the introduction of other database types and drivers like Postgres.
Made easier disabling connection pool by passing
{pooled: false}
options to Pongo Client creation.Consequently, I cleaned up the file structure, grouping it based on the core features, database type, and driver.
In the future, this will also be a basis for Pongo and Emmett's multiple-store capabilities.
Expect a blog on that next week.
Fixes #39