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
laoyao
@laoyao
@brodybits can you help me?
Christopher J. Brody
@brodybits
What are you trying to do?
laoyao
@laoyao
No need to close db?
May i
Christopher J. Brody
@brodybits
No problem if you do not close the db. You know sqlite is ACID compliant, which means it should NEVER lose data once it is committed.
Carson Huang
@kot09
Hi, I'm trying to install the sqlite plugin on windows. I have two questions. 1) Is there a way to install the plugin after a project has been created? I'm reading the instruction to install the plugin using plugman and nufix, but the steps are for creating a new project. 2) The last step mentionned : "Put your sql program in your project www (don't forget to reference it from www\index.html and wait for deviceready event)"; what does it mean to put the sql program in the www project + referencing it?
How did you originally create your project: did you use the Cordova CLI or did you use plugman?
Carson Huang
@kot09
I originally created the project using the Cordova CLI.
Christopher J. Brody
@brodybits
Then use the Cordova CLI to add the plugin and see if it works
Carson Huang
@kot09
That's what I tried before, and for Windows platform, it gives me some error, related to architecture
On iOS, adding the plugin using CLI works perfectly. It's just for the windows platform I'm having issues.
Christopher J. Brody
@brodybits
Are you using Visual Studio to run the program or are you using Cordova CLI to run the program?
Carson Huang
@kot09
I tried both.
Christopher J. Brody
@brodybits
explicitly. In Visual Studio, there is a drop-down for it. When using Cordova CLI, there is an option (I forget which one)
You have to specify which CPU architecture, i.e. x86/x86_64 (or x64, I forget which)/arm
Carson Huang
@kot09
In CLI, I explicitly built it with x86
I'll try it again, give me a second.
Carson Huang
@kot09
@brodybits So I just took a clean copy of my project, added my other plugins + sqlite through CLI. When I build windows, I specifically mention x86 <cordova build windows – --archs="x86">. I then run it using <cordova run -- --windows>, and it gives me the following error: The processor architecture of your project 'neutral' doesn't match the processor architecture 'x86' of the referenced project 'SQLite3'. Change the targeted processor architectures to align between your project and its references.
Carson Huang
@kot09
So I managed to run it. I just need to specify the archs in the run command as well : <cordova run -- --windows archs="x86">
Christopher J. Brody
@brodybits
That ks
Thanks for reporting this, it really needs to be documented somewhere. Maybe I will blog I sometime.
Carson Huang
@kot09
@brodybits Is DELETE available on windows?
_
Christopher J. Brody
@brodybits
Not yet
Carson Huang
@kot09
OKay thanks.
Carson Huang
@kot09
@brodybits Is tehre some work being done for DELETE on windows? If no, what is the issue? I would like to help out.
Christopher J. Brody
@brodybits
A patch would be great. Try to run it against the spec test suite (and enable the tests for windows platform). Also close is not really implemented, which is a prerequisite to do delete correctly (and again test).
Thanks for your interest!
Carson Huang
@kot09
Is there a limit to the db file?
Christopher J. Brody
@brodybits
Not for Android or iOS. If Windows imposes a limit I think it would be extremely high.
Carson Huang
@kot09
Okay thanks. Also, is DROP available on Windows?
Christopher J. Brody
@brodybits
Yes if you use the Cordova windows target (which will work on Windows Phone 8.1). No if you use wp8.
If you use wp8, the plugin simulates DROP by simply deleting all rows from the table.
Carson Huang
@kot09
I'm trying to make an app for my Surface
What if it's just W8?
Christopher J. Brody
@brodybits
The "windows" platform works on Windows 8, Windows 8.1, and Windows Phone 8.1 so it should work
Carson Huang
@kot09
@brodybits Is there a success callback when I use a CREATE table query?
Okay, nevermind, I think I found a way to make it work. Thanks!
Christopher J. Brody
@brodybits
Good to hear.
Carson Huang
@kot09
In a executeSql(), the arguments possible are (sql, values, callbackSuccess, callbackError), correct?
Christopher J. Brody
@brodybits
Yes
Carson Huang
@kot09
For some reason, the callbackError does not have the message attribute
{"db":{"openargs":{"name":"my.db","dblocation":"docs"},"dbname":"my.db"},"txlock":true,"readOnly":false,"executes":[]} is what it returns
Christopher J. Brody
@brodybits
It would help if you can try to make a small test program that demonstrates this issue and raise a bug report. Please make sure you specify which platform, very important
Carson Huang
@kot09
My situation right now is I'm trying to create a table with columns. Do you think that might be the cause?
161 columns&=*
Christopher J. Brody
@brodybits
Should not be
By default build configuration maximum is 2000 columns!
Carson Huang
@kot09
Okay, never, error was on my side... I had two ID columns.