Skip to content

Allow subclassing sqlcipher factory #284

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 6 commits into from
May 29, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented May 27, 2025

In the current implementation, PowerSyncSQLCipherOpenFactory is an interface class. This makes it quite awkward to extend, because you'd have to write a full open factory implementation that delegates to another one (patching methods where necessary). This PR changes the implementation back to a regular class that can be extended, allowing users to e.g. inject custom pragmas or other opening behavior into the factory.

This also adds integration tests for the powersync_sqlcipher package by adding a Flutter app as an example/ subproject that has integration and web tests. These tests mostly serve as a manual regression test for now (they don't run as part of the CI).
The main changes are in packages/powersync_sqlcipher/lib, with tests being in packages/powersync_sqlcipher/example/{test,integration_test}.

@simolus3 simolus3 requested a review from stevensJourney May 27, 2025 21:37
stevensJourney
stevensJourney previously approved these changes May 28, 2025
@simolus3 simolus3 merged commit 6e4ac91 into main May 29, 2025
5 checks passed
@simolus3 simolus3 deleted the allow-subclassing-sqlcipher-factory branch May 29, 2025 15:14
@simolus3 simolus3 mentioned this pull request May 29, 2025
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