sqllite in ionic framework
SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.If you want to store data locally, then sql lite is very useful to use.Now most of the application and some game use sql lite as a local database.So if you can use sqllite in ionic framework to store data.
The task of storing data locally on a device is one such capability, which can make or break the performance of your app. In a web app, we may use localStorage to store data but mobile apps require much data to be store.So that’s why we use mysqlite as a local database in our hybrid app.So let’s start to use mysqlite in step by step.
Step:1
First of all go to your project folder in cmd and install sqlite plugins by using this command
cordova plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git
Then go to your index.html page and add the js file
Step:2
Now go to your app.js file and edit it as the given in below.
If you run the app in browser then you have to access sqlite by openDatabase( ) & if you want to run the app in device then you have to use openDB( ).This is the crucial part of the app development using browser and device.
good