Skip to content

Add Android GRDB SQLCipher support#464

Draft
woodymelling wants to merge 3 commits into
pointfreeco:mainfrom
woodymelling:sqlcipher-android-support
Draft

Add Android GRDB SQLCipher support#464
woodymelling wants to merge 3 commits into
pointfreeco:mainfrom
woodymelling:sqlcipher-android-support

Conversation

@woodymelling
Copy link
Copy Markdown

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


package func write<T: Sendable>(
_ updates: @Sendable (Database) throws -> T
_ updates: @escaping @Sendable (Database) throws -> T
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this is necessary? The database.write method in GRDB being called below only requires a @Sendable closure.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

await withErrorReporting(.sqliteDataCloudKitFailure) {
try await userDatabase.write { db in
for table in tables {
for table in self.tables {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because Skip/Android is using an older version of Swift that doesn't allow an implicit self? Or something else?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is fallout from making this escaping.
Hopefully the final patch will just be the import changes

Comment thread Package.swift
Comment thread Package.swift Outdated
@woodymelling woodymelling force-pushed the sqlcipher-android-support branch from 1a09bc5 to 859746f Compare May 22, 2026 02:33
@woodymelling woodymelling force-pushed the sqlcipher-android-support branch from 859746f to 46e6638 Compare May 22, 2026 02:36
@woodymelling woodymelling marked this pull request as draft May 22, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants