Skip to content

Adding encryption capabilities to incremental-indexeddb-adapter.js #1096

Description

@acdcjunior

Hey, there! I've started using WatermelonDB (in the browser) a couple of months ago and this project I'm in requires the data to be encrypted before storing in IndexedDB.

After a quick research, I found out LokiJS had an encryption-capable adapter. The joy of finding it was short-lived as I also discovered the adapter watermelon actually uses is the incremental-indexeddb-adapter.js@Nozbe/LokiJS which includes some quite important tweaks.

So, cutting to the chase, I have implemented the encryption option in the incremental-indexeddb-adapter.js.

I'm opening this issue here (Nozbe/LokiJS has its issues disabled and this repo seemed like a better fit than the original LokiJS) to actually ask if you were interested in a PR containing the changes I made (which were meant to be backward compatible).
If so, perhaps you'd want to quickly discuss some key points about the code. For instance: what are the target browser versions? The use of var made me believe the code was meant for old browsers, but then I found some includes() which has a poor old-browser support. Also If more refactorings or cleanups could be done or else.

Or we can also just leave this "new" adapter alone and keep it as a community alternative (if someone else eventually has the same requirements and wish to try it out)! All good either way!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions