capacitor-community / sqlite

Community plugin for native & electron SQLite databases
MIT License
433 stars 106 forks source link

Cannot export encrypted database as plain JSON anymore #462

Closed Crecker92 closed 9 months ago

Crecker92 commented 9 months ago

Describe the bug Hi, from version 5.0.6 it is not possible to export an encrypted database as JSON anymore. While the request on issue #227 is understandable and valid, this change - released as a patch - modified the output interface of the exportToJson method and caused an unexpected behaviour on our application. We are now forced to keep using v5.0.5-2 or find a different solution, but would like to keep our dependencies up to date instead.

Would it be possible to reintroduce the previous output? An input flag for encryption/decryption could pilot the desired behaviour.

Thanks a lot for you time!

To Reproduce Create an encrypted db with v5.0.6 or higher. Export the db. Exported data is a base64 string representing the encrypted db.

Expected behavior As per v5.0.5-2, the exported data is a JSON representation of the encrypted db.

jepiqueau commented 9 months ago

@Crecker92 Good point i will look at it

jepiqueau commented 9 months ago

@Crecker92 It will be in the next release. The exportToJson method will have an added parameter encrypted with a default to false.

Crecker92 commented 9 months ago

@jepiqueau Thank you for handling this so promptly! Is there a date for the next release yet?

jepiqueau commented 9 months ago

@Crecker92 version 5.0.8 has been published. Please test on your side and close the issue after

Crecker92 commented 9 months ago

Hi @jepiqueau, tests on our side succeeded :) Thank you!