This is a migrated thread and some comments may be shown as answers.

the verified sqlite plugin doesn't works

1 Answer 47 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hamza
Top achievements
Rank 1
Hamza asked on 14 Apr 2016, 08:14 PM

Hi guys ,

im developping an cross-platforms app (with latest cordova version) and i'm using your verified sqlite plugin i installed it via CLI as written in the documnetation .
when i try to open the database and make sure the table is created and if has some data i can't and in the console i don't get any error except (DB opened !! no error nothing this is my code :

1.db = window.sqlitePlugin.openDatabase({name: "products.db",location: 'default',androidLockWorkaround: 1},function(tx)     db.transaction(function(tx) {         tx.executeSql('CREATE TABLE IF NOT EXISTS products (id integer primary key, product_id INTEGER,title text,price text, picture text,quantite INTEGER)'),function(tx,res){alert(res)}, function(e) {             alert('error: ' + e.message);}});

and evenif i try to check if something is there i don't get any error any message :
1.db.transaction(function(tx){
2.        tx.executeSql("SELECT count(id) as cnt FROM products"),
3.        function(tx,res){
4.            alert(res.rows.item(0).cnt);
5.        }, function(e) {
6.            showNotification('error: ' + e.message);
7.        }

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 19 Apr 2016, 08:08 AM
Hi Hamza,

What OS are you testing the example on. Please note that if you are using Windows Phone, the SQLite plugin no longer supports it. You need to use the legacy version of the plugin:
Cordova/PhoneGap sqlite storage adapter (legacy version)

or use version 1.0.6 of the verified plugin.

If the problem isn't related to WP, please consider opening a support ticket and sending us your project, so we can debug it locally. 

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Apache Cordova
Asked by
Hamza
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or