Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SQLite Plugin OpenDB & CreateTable
var app = {};
app.db = null;
app.openDb = function() {
var dbName = "todo.db";
app.db = window.sqlitePlugin.openDatabase(dbName);
}
app.createTable = function() {
var db = app.db;
db.transaction(function(tx) {
tx.executeSql("CREATE TABLE IF NOT EXISTS " +
"todo(ID INTEGER PRIMARY KEY ASC, todo TEXT, added_on DATETIME)", []);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.