Last active
November 13, 2015 07:37
-
-
Save lohithgn/4aa4f3b7892ebce346a9 to your computer and use it in GitHub Desktop.
SQLite Plugin OpenDB & CreateTable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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