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