Skip to content

Restore encryption support#392

Merged
simolus3 merged 4 commits into
devfrom
encryption-support
Apr 7, 2026
Merged

Restore encryption support#392
simolus3 merged 4 commits into
devfrom
encryption-support

Conversation

@simolus3
Copy link
Copy Markdown
Contributor

@simolus3 simolus3 commented Apr 2, 2026

This restores support for encrypting databases (removed with the package:sqlite_async update in #390). Encrypting databases does not require additional dependencies anymore. Instead, users enable enable encryption by passing the encryption parameter to a PowerSyncDatabase constructor. This makes the open factory run a pragma cipher = statement to encrypt databases.

For this to work, SQLite3MultipleCiphers must be used. The sqlite3 package supports that, but it requires a configuration option in pubspec.yaml. The EncryptionOptions class documents required steps.

This also adds tests using encrypted databases, both on the web and on native platforms (powersync_sqlcipher was essentially untested).

@simolus3 simolus3 force-pushed the merge-sdk-packages branch from 602b0d2 to 64a8a1f Compare April 7, 2026 09:34
@simolus3 simolus3 force-pushed the encryption-support branch from dd34f0b to 3b045fd Compare April 7, 2026 09:52
Base automatically changed from merge-sdk-packages to dev April 7, 2026 10:53
@simolus3 simolus3 force-pushed the encryption-support branch from 3b045fd to 13fd0ca Compare April 7, 2026 10:54
@simolus3 simolus3 marked this pull request as ready for review April 7, 2026 10:59
@simolus3 simolus3 requested a review from rkistner April 7, 2026 11:00
@simolus3 simolus3 merged commit e9f7e6c into dev Apr 7, 2026
3 checks passed
@simolus3 simolus3 deleted the encryption-support branch April 7, 2026 11:14
@simolus3 simolus3 mentioned this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants