Closed andreazorzi closed 6 years ago
Hi, where is located your database file? Could you try a more minimal example which INSERT
some records, and then SELECT
them?
Hi, I've done some tests and the database file is in the same folder as the javascript file that is running the code. I also tried with an INSERT query, but it always gives me the error that the table does not exist
The database is automatically created and it should be stored in something like Library/LocalDatabase
(see https://github.com/litehelpers/Cordova-sqlite-storage#opening-a-database). Also, before using INSERT
, you have to use CREATE TABLE
.
Hi, I'm trying to open a .db file, it does not give me errors when I try to open but the query tells me that it does not find the table, the .db file is correct and contains the query table, it seems as if instead of opening it create a new database.
This is my code:
`var SQLite = window.cordova.require('cordova-sqlite-plugin.SQLite'); var sqlite = new SQLite('clienti.db');
sqlite.open(function(err) { if (err){ throw err; }
});`