-
Notifications
You must be signed in to change notification settings - Fork 715
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window.sqlitePlugin.echoTest is not a function, db.executeSql is not a function #784
Comments
I need to create file tiCorporativoMobile.db into root project? |
MY CONFIG XML
|
Your config.xml indicates that you have both cordova-sqlite-storage and cordova-plugin-sqlite-2 installed, which may lead to undefined results such as build errors and data loss issues discussed in #626, #719, and #776. Please completely remove each sqlite plugin, double-check, and install the one desired. The other possible issue is that you must wait for the deviceready event before using this or any other Cordova plugin. |
I'm using "document.addEventListener('deviceready', function() {" to wait device.
|
You should not need to do anything like that. This plugin will create the database if it does not already exist. If you want pre-populated database then please use cordova-sqlite-ext plugin version.
Image indicates to me that you are using Web SQL database.
no
yes |
I'm removing sqlite-2 with "cordova plugin rm --save", and also removed from config.xml and plugins / fetch.json. Even so when "run" it reinstalls the plugin. Can you help me? What is the problem with GIT? |
I forgot to mention that you should also completely remove all versions of sqlite plugin from package.json as well as config.xml. Also this plugin does NOT support browser platform. Here is what I would recommend:
It is also possible to use the browser platform for testing if you use my sql-promise-helper project as described in brodycj/sql-promise-helper#4. |
I rebuild the project, being careful with all the items spoken here. Worked well! |
On May 4, 2018 1:48 PM, "Guilherme Lessa" <[email protected]> wrote:
I rebuild the project, being careful with all the items spoken here. Worked
well!
Thanks for confirming. Definitely not so intuitive:-|
|
The functions return as undeclared. db.executeSql, batch, echoTest, all...
I'm having the same problem with the plugin nolanlawson/cordova-plugin-sqlite-2
CONSOLE LOG IMAGE:
https://ibb.co/bKsYKS
db = window.sqlitePlugin.openDatabase({
name: 'tiCorporativoMobile.db',
version: '1.0',
location: 'default'
});
console.log(db);
window.sqlitePlugin.echoTest(function() {
console.log('ECHO test OK');
});
db.executeSql('DELETE FROM configuracoes', [], function(rs) {
}, function(error) { //+ error.message
});
help-me please!
The text was updated successfully, but these errors were encountered: