microsoft / cordova-plugin-websql

Cordova WebSQL Plugin
Other
61 stars 40 forks source link

openDatabase callback doesnt work #9

Closed 4gus71n closed 9 years ago

4gus71n commented 10 years ago

The callback of the openDatabase function, the same one that is in the example, doesnt work on my deploy of windows phone. The only way that I have to know when the database is open is this one:

... var dbSize = 5 * 1024 * 1024; // 5MB // open database app.db = openDatabase("Todo", "", "Todo manager", dbSize, function() {

    });
    setTimeout(function() {
        app.db.transaction(function (tx) {
            tx.executeSql("CREATE TABLE IF NOT EXISTS todo(ID INTEGER PRIMARY KEY ASC, todo TEXT, added_on DATETIME)", [], app.onSuccess, app.onError);
        });
    }, 1000);

...

No exception nor error is throw. I did the deploy in a Nokia 925, the cordova build didnt throw any error.

Typhlosaurus commented 10 years ago

@astinx: This definitely was an issue, but should be resolved now. Could you confirm that you are still seeing the issue with the current version of the plugin?

4gus71n commented 10 years ago

@Typhlosaurus The error is still there. Maybe I did not update the plugin right. I removed it using: cordova plugin rm com.msopentech.websql Then I installed again from the git repo with: cordova plugin add https://github.com/MSOpenTech/cordova-plugin-websql And I did the build with cordova build. Maybe the plugin files are cached somewhere in cordova/nodejs? Is that possible?

Typhlosaurus commented 10 years ago

@astinx, my apologies: I wasn't paying attention. I've been watching this project while working with https://github.com/brodysoft/Cordova-SQLitePlugin. This issue was recently fixed in the brodysoft repo. I would recommend switching to that project as it's more complete and under active development. Just one proviso: the brodysoft implementation supports iOS, Android and WP8 but does not support full Windows 8.

daserge commented 9 years ago

This should work correctly now.