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.
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
[Fix] Common SDK fixes for Web and React Native #24
[Fix] Common SDK fixes for Web and React Native #24
Changes from 18 commits
280ab96
60dea73
e6f021c
271035f
bccb255
43593b0
761ea8c
da1fa1a
df4cf7d
b23d2e4
7302316
7f7d857
188f14f
2c0a54f
961f544
fc2eb5d
bee2cba
f67ed20
37612c1
1391a69
e2fab7f
8bcbcd4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What is a
top-level
read-only execute method?According to the comment,
get
,getAll
andgetOptional
should use this, but it does not seem to be the caseThere 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.
The DB adapter and the powersync client expose SQL execution methods such as
execute
,getAll
,get
andgetOptional
on the class (top-level) e.g.db.execute()
,db.get()
and they also expose these methods in lock and transaction contexts e.g.tx.get()
.The top-level
get
functions were previously using the top-levelexecute
function which would actually schedule a writeLock and then use the writeLock's contextexecute
method. These methods should actually be using areadLock
instead since those can execute concurrently with writeLocks. This method provides a read onlyexecute
method on the DB adapter class as shorthand for starting a readLock and using it'sexecute
method.This method is used to create the top-level
get
helpers here https://github.com/journeyapps/powersync-react-native-sdk/blob/fc2eb5d9bf74e71ee3cd7fe896ecba5ca4f27081/packages/powersync-sdk-react-native/src/db/adapters/react-native-quick-sqlite/RNQSDBAdapter.ts#L30