Merged
Conversation
🦋 Changeset detectedLatest commit: 8e1def5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
stevensJourney
previously approved these changes
Mar 11, 2026
Collaborator
stevensJourney
left a comment
There was a problem hiding this comment.
I really really love these changes. These are a welcome addition. Thank you for implementing this.
I tested the React Native Supabase Todolist (iOS) on my machine. That compiled and ran without issues for me.
I also tested the React Native OP-SQLite barebones app. This had some iOS lockfile issues, but after fixing those - the demo worked normally for me.
packages/react-native/src/db/adapters/react-native-quick-sqlite/RNQSDBAdapter.ts
Outdated
Show resolved
Hide resolved
df227c3 to
8e1def5
Compare
stevensJourney
approved these changes
Mar 11, 2026
This file contains hidden or 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
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.
A lof of our
DBAdapterimplementations are very similar:get(),getOptional()andgetAll()implementations delegate toreadLock((ctx) => ctx.respectiveMethod(...)).internalTransactionmethod onreadLockandwriteLock(except for RNQS, where the exact same transaction wrapper is instead defined in@journeyapps/react-native-quick-sqlite).get(),getOptional()andgetAll()are implemented as wrappers overexecute().Given that the implementations are so similar, we should try to share them! Currently, RNQS, OP-SQLite, Capacitor, web, sql.js and node all use duplicate implementations that are exactly the same. If we add a Tauri SDK in the future, it would also have to duplicate this. This is also annoying for users: If an
DBAdapterimplementation didn't require around 100 lines of boilerplate, it would be much easier for users to write their own implementations (see e.g. #845 where that's relevant).So, this:
ConnectionPoolinterface which just defines the "intrinsic" top-level methods (name,close,readLock,writeLockandrefreshSchema). It adds theDBAdapterDefaultMixinmixin which can turn a class implementingConnectionPoolinto a class implementingDBAdapterby delegating toreadLockorwriteLock, respectively.SqlExecutorinterface defining theexecute,executeBatchandexecuteRawmethods. Similarly to the connection pool setup,DBGetUtilsDefaultMixinallows implementingget(),getAllandgetOptionalby wrappingexecute.The web worker setup is left unchanged for now, I'll revisit that in a follow-up PR. The reason is that I believe the web worker setup could benefit from adopting an architecture similar to the one used in the Node SDK, where clients contain most of the logic and workers just execute raw statements. But that's a non-trivial refactoring, so I wanted to get this out first.
I'm relying on existing unit tests for web, sql.js, node and op-sqlite here. I've tested capacitor manually, unfortunately I can't seem to get any RN demos to even compile on my machine.