Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 845 Bytes

README.md

File metadata and controls

46 lines (34 loc) · 845 Bytes

cordova-sqlite-storage-js

Javascript library to use cordova-sqlite-storage plugin easily

Configure

var db_config = {
  name: 'your_db_name.db',
  location: 'default'
};

Usage

db_query

function success_callback(){
    // no parameter
    alert('success');
}

function error_callback(error){
    // receives error data
    alert(error.message);
}

db_query("INSERT INTO users VALUES (?,?)", ['demo', '1234'], success_callback, error_callback);

db_select

function success_callback(result){
    // receives result rows
    alert(result.rows.item(0)); // first row
}

function error_callback(error){
    // receives error data
    alert(error.message);
}

db_select("SELECT * FROM users WHERE login = ?, password = ?", ['demo', '1234'], success_callback, error_callback);