0

I have used the SQLite plugin listed on ionic 3 packages here. But now I want to store the data in an encrypted format. For that , I am trying to implement cordova-sqlcipher-adapter plugin but I am unable to get started as I am confused whether to use it with the SQLite plugin or use it as a standalone plugin for sqlite db operations? I have gone through the documentation but I am unable to get started.

Help is really appreciated.

Thanks in advance!

1 Answer 1

1

Do following in order to use cordova-sqlcipher-adapter (it works for me)

  1. remove SQLite plugin (Keep SQLlite npm package, I have used SQLite4)
  2. cordova plugin add cordova-sqlcipher-adapter
  3. In app.modules.js

import { SQLite } from '@ionic-native/sqlite';
...
providers: [
    ....
    SQLite,

Now, use below to create db and use it

var db = (<any>window).sqlitePlugin.openDatabase({
  name: 'demo.db',
  key: 'secret-key',
  location: 'default'
});

And Follow link for other db opertations

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.