Add Android GRDB SQLCipher support#464
Draft
woodymelling wants to merge 3 commits into
Draft
Conversation
mbrandonw
reviewed
May 22, 2026
|
|
||
| package func write<T: Sendable>( | ||
| _ updates: @Sendable (Database) throws -> T | ||
| _ updates: @escaping @Sendable (Database) throws -> T |
Member
There was a problem hiding this comment.
Can you explain why this is necessary? The database.write method in GRDB being called below only requires a @Sendable closure.
Author
There was a problem hiding this comment.
This is a req of the current swift-everywhere/grdb-sqlcipher fork.
I'm looking into why that's happening, and if it's a straightforward update.
I'll mark this as draft until we're able to squash this back to the GRDB shape.
mbrandonw
reviewed
May 22, 2026
| await withErrorReporting(.sqliteDataCloudKitFailure) { | ||
| try await userDatabase.write { db in | ||
| for table in tables { | ||
| for table in self.tables { |
Member
There was a problem hiding this comment.
Is this because Skip/Android is using an older version of Swift that doesn't allow an implicit self? Or something else?
Author
There was a problem hiding this comment.
No, this is fallout from making this escaping.
Hopefully the final patch will just be the import changes
mbrandonw
reviewed
May 22, 2026
mbrandonw
reviewed
May 22, 2026
1a09bc5 to
859746f
Compare
859746f to
46e6638
Compare
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.
groue/GRDB.swift#1708
This is a PR to use the same SQLCipher trait that is employed over in GRDB to support Android.
This is an initial path that seems to allow compiling for Android through skip, but there may be better ways to do it.
It seems that the grdb-sqlcipher needs some updates to match GRDB, so there's a little bit of shim code in here for the time being. I'll work on getting that updated while we discuss