Change ionic database path 5

I am working with ionic 5 and sqlite and I need to know how I can change the default path in which the sqlite database is created on my device, since I currently do not know what the default path is and so far I have not found anything that can help me


  if (!this.isOpen) {

  this.sqlite = new SQLite();    

  this.sqlite.create({ name: "data.db", location: "default",createFromLocation: 1 }).then((db: SQLiteObject) => {

  this.db = db;

      this.isOpen = true;

    }).catch((error) => {





Unless you have really good reasons for avoiding doing so, I would recommend always using Capacitor or Ionic-Native to interface with plugins. As you can see in the documentation, you don’t instantiate SQLite objects directly like you are: instead you inject an SQLite and call a create method on it.

The rest of this post assumes you’re using the underlying plugin referred to above. If not, consult the documentation for whatever plugin you are using.

This is platform-specific, and extensively documented here. The bottom line is that on Android, the database goes where it goes. On iOS, you have some options, but with the iosDatabaseLocation option. The location option you are using is effectively pointless.