Experimenting with encryption #82
Draft
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.
Following the Kotlin SDK work in powersync-ja/powersync-kotlin#277, this adds some tests to verify that we can link and use SQLCipher.
An issue is that we currently have to use SQLCipher. My preferred solution would be to have two targets (say
PowerSync
andPowerSyncEncryption
) where one offers encryption support and one doesn't. Unfortunately, easier said than done:libsqlite3
, the "normal"PowerSync
target would have to link it in Swift.PowerSyncEncryption
, which links SQLCipher, can't depend on the normal target with all the sources.I've considered introducing a shared target, but SwiftPM doesn't allow overlapping sources. Having a
Common
target here that doesn't link SQLite might work, but that would change public imports.I think package traits may be a decent way to fix this, but they would require a higher minimum Swift version. So this is left in an experimental stage for now, we can revisit this after the Kotlin changes have been merged.