Skip to main content

SQLite

Access SQLite databases on the device.

https://github.com/litehelpers/Cordova-sqlite-storage

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

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#

$ npm install cordova-sqlite-storage
$ npm install @ionic-native/sqlite
$ ionic cap sync

Supported Platforms#

  • Android
  • iOS
  • macOS
  • Windows

Usage#

React#

Learn more about using Ionic Native components in React

Angular#

import { 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));