ionic-team / ionic-team/ionic-storage

Where is the iOS sqlite .db file located?

Open
#242 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
456
Forks
97
PR merge metrics
No merged PRs in 30d

Description

Hi there,

I'm trying to use sqlite on iOS to persist data on the iOS device however I can't seem to locate the .db file.

Where can I find the .db sqlite database file on iOS?

I'm using the following code that seems to be adding/retrieving the relevant data and Safari debugger doesn't show the database in the "Storage" section whilst running an Ionic/Vue app on an iPad.

Installation steps:
```
npm install @ionic/storage
npm install cordova-sqlite-storage
npm install localforage-cordovasqlitedriver
```

Code to interact with DB (which is successful, from what I can tell but I can't find the file)

```javascript
import { Drivers, Storage } from '@ionic/storage';
import * as CordovaSQLiteDriver from 'localforage-cordovasqlitedriver';

const sqliteStorage = new Storage({
name: '__mydb',
driverOrder: [CordovaSQLiteDriver._driver, Drivers.IndexedDB, Drivers.LocalStorage]
});

await sqliteStorage.defineDriver(CordovaSQLiteDriver)
await sqliteStorage.create();
await sqliteStorage.set(media.name, JSON.stringify(media))
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.