Skip to content

Javascript library to use cordova-sqlite-storage plugin easily

Notifications You must be signed in to change notification settings

themahabbat/cordova-sqlite-storage-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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);

About

Javascript library to use cordova-sqlite-storage plugin easily

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published