database.js

var queries = [ "DROP TABLE IF EXISTS Users;", "DROP TABLE IF EXISTS Products;", "DROP TABLE IF EXISTS Categories;", "CREATE TABLE Users (IdUser integer primary key , FirstName text not null);", "CREATE TABLE Categories(IdCategory integer primary key, Name text not null);", "CREATE TABLE Products(IdProduct integer primary key autoincrement, Name text not null, IdCategory integer not null);", "INSERT INTO 'Users' ('IdUser','FirstName') VALUES (1, 'Daniel');", "INSERT INTO 'Categories' ('IdCategory','Name') VALUES (1, 'Computadores');", "INSERT INTO 'Categories' ('IdCategory','Name') VALUES (2, 'Celulares');", "INSERT INTO 'Products' ('Name','IdCategory') VALUES ('Note 4', 2);" ];
SQLite plugin with ngCordova in Ionic Framework => Using service pattern (Works for litehelpers/Cordova-sqlite-storage and MSOpenTech/cordova-plugin-websql) Code => http://1drv.ms/1Ono0Ys

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.