I'm using the code below to interact with sqlite Database.
var defferd = $q.defer();
var db = openConn('test1','1.0.0' , 'test1' , 200000);
db.transaction(insertUserInformation, errorDB, successDB);
function insertUserInformation(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS USERINFO (ID UNIQUE, USERNAME , FULLNAME , PROFILEPIC , ACCESS_TOKEN)');
}
function openConn(databaseName, dbVersion, dbShowName, dbSize){
return window.openDatabase(databaseName, dbVersion, dbShowName, dbSize);
}
function errorDB(tx, err) {
defferd.reject(err);
}
function successDB() {
defferd.resolve(result)
}
return defferd.promise;
after running this codeit's OK. but when I change query to insert , errorDB function gets triggered but no error returns and I can't figure out what is that's error.
how can I handle to errors of sqlite transactions
Aucun commentaire:
Enregistrer un commentaire