feat(core): allow specifying transaction isolation level #2116
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.
The default isolation level in some databases (see e.g. for postgres https://www.postgresql.org/docs/current/transaction-iso.html -
READ COMMITTED
is default) allows several anomalies, leading to incorrect data. https://en.wikipedia.org/wiki/Isolation_%28database_systems%29 for more context (or do some googling).I think it would make sense to at least easily allow users to opt in to stronger isolation levels, and preferably do so by default (picking a lower isolation level should only be done when really needed and when you understand what you're doing).
This PR aims to achieve the above. Note that I'm not a seasoned typescript developer, and I had some issues with
yarn
in this repo, so I had to bypass the pre-commit hook.