Search docs/
Getting StartedPlugins

SQLite Porter

This Cordova/Phonegap plugin can be used to import/export to/from a SQLite database using either SQL or JSON.



Contact Us Today!


ionic cordova plugin add install @ionic-native/sqlite-porternpm install install @ionic-native/sqlite-porterionic cap sync
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、エンタープライズプラグインに興味があれば 連絡ください


  • Amazon Fire OS
  • Android
  • BlackBerry 10
  • Browser
  • iOS
  • Tizen
  • Windows
  • Windows Phone


Using React?

See here.

import { SQLitePorter } from '@ionic-native/sqlite-porter/ngx';

constructor(private sqlitePorter: SQLitePorter) { }


let db = window.openDatabase('Test', '1.0', 'TestDB', 1 * 1024);
// or we can use SQLite plugin
// we will assume that we injected SQLite into this component as sqlite
  name: 'data.db',
  location: 'default'
  .then((db: any) => {
    let dbInstance = db._objectInstance;
    // we can pass db._objectInstance as the database option in all SQLitePorter methods

let sql = 'CREATE TABLE Artist ([Id] PRIMARY KEY, [Title]);' +
           'INSERT INTO Artist(Id,Title) VALUES ("1","Fred");';

this.sqlitePorter.importSqlToDb(db, sql)
  .then(() => console.log('Imported'))
  .catch(e => console.error(e));