Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Cordova-fs-adapter #165

Open
mesqueeb opened this issue Apr 8, 2019 · 6 comments
Open

[Request] Cordova-fs-adapter #165

mesqueeb opened this issue Apr 8, 2019 · 6 comments

Comments

@mesqueeb
Copy link

mesqueeb commented Apr 8, 2019

I'm currently using the old LokiJS, which is great, but when the new LokiDB releases, I'd love to switch. 馃攧

I see there's a wonderful arsenal of adapters ready for LokiDB.
There is only one adapter that I'd like to request extra. 馃搶

This adaptor is abandoned three years ago but still works on cordova v8 and cordova-ios v5 versions in my tests. It's amazing as it allows cordova apps to save Loki data to the File Storage. Which is persistent (unlike indexedDB which might get deleted by iOS during low memory).

If any one of you JS Gurus could look at the source code (only 100 lines!) and create an official version for LokiDB that'd be super cool! 馃槑

If any further information is required on Cordova File Storage, they have a great guide on this in their docs.

Happy easter! 馃 馃椏

@greaterking
Copy link

I was able to do that ...please check out #84 I haven't had time to put in a repo yet.

@mesqueeb
Copy link
Author

Hi @greaterking thanks for your comment!!
Unfortunately i don鈥檛 use ionic. :(
I use VueJS with Cordova ;)

@greaterking
Copy link

@mesqueeb hopefully you'll be able to port this over somehow I hope since its all js in the end ..but glad I could help :)

@Marko-Matijevic
Copy link

@mesqueeb Is it true that iOS on low memory is deleting indexedDB persistent memory? I am making an Ionic4 app for iOS and I need to use persistent memory for a huge amount of data. Can you please reply, its critical. Thank you

@mesqueeb
Copy link
Author

It's true. You need to use Filestorage instead. Don't know how to best do that.

@greaterking
Copy link

greaterking commented Jun 27, 2019

As mentioned earlier you need to use the file storage adapter which leverages the official Cordova file plugin to persist the data to the devices file system. Since the adapter part of Loki isn鈥檛 tightly coupled you should be able to write your own..I did for use with ionic. Other frameworks you鈥檒l just have to look at existing examples, build and share. If not you鈥檒l have to use another lib like couchdb and others.

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

3 participants