Skip to main content

Posts

Showing posts from October, 2017

Ionic 3 Sqllite connection setup

It is too simple thing to set up the local db connection for local storage in ionic. But why am i writing blog for simple thing? Because we make complex with the simple thing only! i myself made complex with this simple thing. To setup the environment for sqllite please fallow  here . Document which will be updated as and when the new version of the Ionic get published.  Document showed the following steps when i referred it. Install the Cordova and Ionic Native plugins: $ ionic cordova plugin add cordova-sqlite-storage $ npm install --save @ionic-native/sqlite Usage import { SQLite, SQLiteObject } from '@ionic-native/sqlite' ; constructor (private sqlite: SQLite) { } ... this .sqlite.create({ name: 'data.db' , location: 'default' }) .then((db: SQLiteObject) => { db.executeSql( 'create table danceMoves(name VARCHAR(32))' , {}) .then(() => console .log( 'Executed SQL' )) .catch(e => console .log(