A Cordova/PhoneGap plugin to open and use sqlite databases on Android/iOS/Windows Universal(8.1)/WP(7/8) with HTML5/Web SQL API
People
Repo info
Activity
William Wilkerson
@phpmypython
option 0 im aware will save to the documents directory which can be accessed using cordova.file.documentsDirectory but im unsure of the others
Christopher J. Brody
@brodybits
For iOS ONLY: option 1 stores the DB in /var/mobile/Applications/<UUID>/Library
and option 2 stores the DB in /var/mobile/Applications/<UUID>/Library/LocalDatabase (which is automatically created by the plugin)
William Wilkerson
@phpmypython
is there a cordova file function that retrieves this path? also thanks for replying i really appreciate it.
Christopher J. Brody
@brodybits
CORRECTION:
for option 0: cordova.file.documentsDirectory
for option 1: cordova.file.applicationStorageDirectory + '/Library'
for option 2: cordova.file.applicationStorageDirectory + '/Library/LocalDatabase'
William Wilkerson
@phpmypython
Thanks so much @brodybits i really appreciate the work you've done here
vurgun533
@vurgun533
selam
naber
nasılsın
sex
deneme
@phpmypython demo
Yang Zhou
@yz89
hello. I have a question. @brodybits when I just open and close the ‘db’ on the same database file repeatedly, the memory always increasing. It not really close?
Alin Pandichi
@apandichi
Hello. I am wondering how would one handle database migrations with this plugin. Any suggestions? Thanks!
Christopher J. Brody
@brodybits
@brodybits when I just open and close the ‘db’ on the same database file repeatedly, the memory always increasing. It not really close?
@yz89 if you see memory increasing when you repeatedly open and close the same database file, that is a memory leak. Please report which platform(s) you see the memory leak, a test program that can reproduce the leak, and also how you were able to measure the leak.
Christopher J. Brody
@brodybits
@apandichi can you be more specific about what kind of database do you want to migrate, where you want to migrate it from, etc?
Alin Pandichi
@apandichi
that's not what i meant. for example, in my app version 1, i have a table with 3 columns. in app version 2, i want this same table to have 3 columns. where does the "alter table" go? i remember the websql api had a method like changeVersion
correction: v1 - 2 columns; v2 - 3 columns
Christopher J. Brody
@brodybits
This plugin does not support the versions like the WebSQL API. This is already documented in the "Other Limitations" section and this point should be made more clear.
The suggested workaround is to add a special version table with a single record to specify your version number. Upon startup, if your app detects the version is too old, or the version table is not present, then alter the table and update the version table (or create it if not present).
_
Alin Pandichi
@apandichi
understood. thanks for your help!
Christopher J. Brody
@brodybits
no problem
Ásgeir Úlfarsson
@asgeiru
I am bit lost here at the moment. I have up and running phonegap application that uses https://github.com/jbavari/cordova-plugin-video-editor to transcode video. When I add SQLite as plugin the transcoding plugin starts to crash the program because it is looking for libloader-jni.so file (part of transcode plugin in sub directory). It seems somehow after I added SQLite it does not any more look for *.so files in subdirectory. :/ Any ideas?
Christopher J. Brody
@brodybits
@as
Christopher J. Brody
@brodybits
@asgeiru I am suspecting there is a confusion since the sqlite plugin provides armeabi and armeabi-v7a so libs, while the cordova-plugin-video-editor only provides an armeabi-v7a library. Try removing the armeabi lib directory and see if you continue to get this problem.
Ásgeir Úlfarsson
@asgeiru
ok ty, will test that
Ásgeir Úlfarsson
@asgeiru
Solved it. :) Removed both arm64-v8a and armeabi directory
You know if this can cause some issues for me on the long run?
Ásgeir Úlfarsson
@asgeiru
@brodybits thank you btw.. :)
Christopher J. Brody
@brodybits
@asgeiru happy to hear! I will update README.md when I get a chance.
Ásgeir Úlfarsson
@asgeiru
(y)
Christopher J. Brody
@brodybits
The only thing is that your app will only work on the newer ARM processor now.
Not sure about ARM 64-bit.
Ásgeir Úlfarsson
@asgeiru
ahh
Christopher J. Brody
@brodybits
We know this limitation is because of the cordova-plugin-video-editor. We should file a bug on that project when we get a chance.
Ásgeir Úlfarsson
@asgeiru
yeah, will do that thank you.
that repo has not been very responsive though with issues
will have to figure this out my self I think. :) but ty for help. Now I at least know what the issue is
Christopher J. Brody
@brodybits
Right. It is still good to file an issue so it can help others. Also it would help me if you file an issue on my plugin so I don't lose track of this. I suspect this is something that should really be checked by the Cordova project itself.
Ásgeir Úlfarsson
@asgeiru
I will do that in the morning. :) Thank you for the assistance.
Christopher J. Brody
@brodybits
:+1:
Ásgeir Úlfarsson
@asgeiru
I have added issues with both plugins. Thank you for the assistance. :smile:
Christopher J. Brody
@brodybits
No problem :+1:
Javier
@jlegido
Good morning everybody, first time using this chat
Raja Dinesh
@Dineshrajaa
Hello Brodybits, Thanks for making such a awesome plugin now I am having a small question , the Cordova's plugin resource has been changed to npm so have you moved Cordova-Sqlite-Plugin to npm registry?