@capgo/capacitor-data-storage-sqlite
Overview
Section titled “Overview”Open a named store, set keys, and query values without writing SQL by hand. Switch tables inside a store, migrate JSON payloads, and enable encryption on iOS and Android when you need at rest protection beyond the OS sandbox.
Typical fits: offline settings, draft forms, cached API payloads, and feature flags that must survive process restarts.
Platform support
Section titled “Platform support”| Platform | Support | Notes |
|---|---|---|
| iOS | Yes | SQLite via community storage layer |
| Android | Yes | SQLite with optional encryption |
| Web | Yes | IndexedDB backed implementation |
Core Capabilities
Section titled “Core Capabilities”openStore- Open a store.closeStore- Close the Store.isStoreOpen- Check if the Store is opened.isStoreExists- Check if the Store exists.
Public API
Section titled “Public API”| Method | Description |
|---|---|
openStore | Open a store. |
closeStore | Close the Store. |
isStoreOpen | Check if the Store is opened. |
isStoreExists | Check if the Store exists. |
deleteStore | Delete a store. |
setTable | Set or Add a table to an existing store. |
set | Store a data with given key and value. |
get | Retrieve a data value for a given data key. |
remove | Remove a data with given key. |
clear | Clear the Data Store (delete all keys). |
iskey | Check if a data key exists. |
keys | Get the data key list. |
values | Get the data value list. |
filtervalues | Get the data value list for filter keys. |
keysvalues | Get the data key/value pair list. |
isTable | Check if a table exists. |
tables | Get the table list for the current store. |
deleteTable | Delete a table. |
importFromJson | Import a database From a JSON. |
isJsonValid | Check the validity of a JSON Object. |
exportToJson | Export the given database to a JSON Object. |
getPluginVersion | Get the native Capacitor plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-data-storage-sqlite.
Keep going from @capgo/capacitor-data-storage-sqlite
Section titled “Keep going from @capgo/capacitor-data-storage-sqlite”If you are using @capgo/capacitor-data-storage-sqlite to plan storage and file handling, connect it with Using @capgo/capacitor-data-storage-sqlite for the native capability in Using @capgo/capacitor-data-storage-sqlite, @capgo/capacitor-file for the implementation detail in @capgo/capacitor-file, Using @capgo/capacitor-file for the native capability in Using @capgo/capacitor-file, @capgo/capacitor-uploader for the implementation detail in @capgo/capacitor-uploader, and Using @capgo/capacitor-uploader for the native capability in Using @capgo/capacitor-uploader.