SQLite
Access SQLite databases on the device.
https://github.com/litehelpers/Cordova-sqlite-storage
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.
Installation#
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-sqlite-storage $ npm install @ionic-native/sqlite $ ionic cap sync
$ ionic cordova plugin add cordova-sqlite-storage $ npm install @ionic-native/sqlite
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us
#
Supported Platforms- Android
- iOS
- macOS
- Windows
#
Usage#
ReactLearn more about using Ionic Native components in React
#
Angularimport { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';
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(e));
}) .catch(e => console.log(e));