Skip to content

Extend PowerSyncSQLCipherOpenFactory not possible anymore #264

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

Open
js2702 opened this issue Apr 4, 2025 · 1 comment
Open

Extend PowerSyncSQLCipherOpenFactory not possible anymore #264

js2702 opened this issue Apr 4, 2025 · 1 comment

Comments

@js2702
Copy link

js2702 commented Apr 4, 2025

We were using version 1.1.1 of powersync_core and we had a custom sqlite_cipher open factory that would attach databases on open. Now on the latest version it doesn't seem to be possible to do that because the behavior of the SQLCipherOpenFactory was moved to the _NativeCipherOpenFactory.

Is it possible to customize the default SQLCipher factory without recreating all the methods? (Open and PRAGMA statements)

@simolus3
Copy link
Contributor

simolus3 commented Apr 4, 2025

This was changed to re-use parts of the implementation between the native and the web factory here. Unfortunately the setup here is a bit weird in general (the web factory implementation has a different class hierarchy, so it's not easy to unify the two). We could look into adding conditional exports to expose the right type though.

A temporary workaround may be to copy _NativeCipherOpenFactory into your project to make the modifications there.

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

No branches or pull requests

2 participants