Allow subclassing sqlcipher factory #284
Merged
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.
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 anexample/
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 inpackages/powersync_sqlcipher/example/{test,integration_test}
.