-
Notifications
You must be signed in to change notification settings - Fork 7
GRDB Support #78
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
Merged
Merged
GRDB Support #78
Conversation
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
groue
reviewed
Sep 8, 2025
simolus3
reviewed
Sep 17, 2025
groue
reviewed
Sep 23, 2025
groue
reviewed
Sep 23, 2025
simolus3
reviewed
Jan 5, 2026
Contributor
simolus3
left a comment
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.
This looks really nice, I'm very happy with the GRDB implementation. Glad that all the effort to move to CSQLite is finally paying off :D
I only have a few minor comments, the implementation overall looks good to me.
Demo/GRDB Demo/GRDB Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Show resolved
Hide resolved
simolus3
approved these changes
Jan 5, 2026
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.
Overview
This builds off the amazing work of powersync-ja/powersync-kotlin#230. The linked PR adds support for creating a
PowerSyncDatabaseby supplying a customSQLiteConnectionPoolwhich manages SQLite connections.Some small additions and wip tests were added to the Kotlin implementation here
This PR adds Swift bindings to the Kotlin PR and then adds a
PowerSyncGRDBProduct to our SPM package. This product adapts a GRDB DatabasePool to aSQLiteConnectionPoolaccepted by the PowerSync SDK.This makes use of the fact that GRDB exposes the raw C SQLite pointer for it's connections. We then use this pointer with the newly introduced native
Databasekotlin implementation.The
PowerSyncGRDBproduct provides a means to generate a GRDBConfiguration. This configuration is used when creating the GRDBDatabasePool. We supply implementation for the configuration to load our PowerSync Rust core extension.APIs are still a WIP
Consumers can create a Pool with:
Consumers can then pass this pool when creating the PowerSyncDatabase.
Using the
DatabasePoolin the PowerSync SDK results in the same locking mechanisms being used between instances of thePowerSyncDatabaseandDatabasePool. Consumers should be safe to alternate between both clients.Demo
A new GRDB demo application has been added to the
demosfolder. This demo uses GRDB queries in Views.grdbdemo.mp4
TODOs:
Implement LeaseAll to lease all GRDB connections if possible