SQLite plugin in ionic 3
This plugin provides the access SQLite database on the device. This is an in-process library that implements a serverless and SQL database engine. The complete database has multiple tables with the process of insertion, select, create, update and view the table.
Installation
Use cordova sqlite plugin to access sqlite database and store all data locally.
ionic cordova plugin add cordova-sqlite-storage
npm install --save @ionic-native/sqlite
Step-1
Import the SQLite in own module page, it optimizes the app and reduces lazy loading, and add the module name in provider in module page.
Step-2
Import the SQLite in ts file and create a database and table once by using(create if not exist), it will create once and insert and view the table. the plugin only uses in the mobile.
Step-2
If the table and database are created, then insert a data locally and use SQLite in any page and retrieve the data.
Step-3
select the data locally and store display it.
0 Comments