⚡Capacitor plugin for native & electron SQLite databases.
Swift
664
819 commits
updated Aug 6, 2026

@capacitor-community/sqlite
Capacitor community plugin for Native and Electron SQLite Databases. - In Native, databases could be encrypted with `SQLCipher` - In Electron, databases could be encrypted with `better-sqlite3-multiple-ciphers`
| Maintainer | Company | GitHub | Social |
|---|---|---|---|
| Robin Genz | Capawesome | robingenz | @robin_genz |
[!IMPORTANT]
This plugin uses the SQLCipher library (even for unencrypted databases), which is subject to the Encryption Export Regulations and may require you to submit a year-end self-classification report to the U.S. government. Read more here.
npm install --save @capacitor-community/sqlite
npx cap sync
yarn add @capacitor-community/sqlite
npx cap sync
pnpm install --save @capacitor-community/sqlite
pnpm install --save jeep-sqlite
pnpm install --save sql.js
npx cap sync
then add plugin to main capacitor.config.ts file:
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.jeep.app.ionic7.angular.sqlite',
appName: 'ionic7-angular-sqlite-starter',
webDir: 'www',
server: {
androidScheme: 'https'
},
plugins: {
CapacitorSQLite: {
iosDatabaseLocation: 'Library/CapacitorDatabase',
iosIsEncryption: true,
iosKeychainPrefix: 'angular-sqlite-app-starter',
iosBiometric: {
biometricAuth: false,
biometricTitle : "Biometric login for capacitor sqlite"
},
androidIsEncryption: true,
androidBiometric: {
biometricAuth : false,
biometricTitle : "Biometric login for capacitor sqlite",
biometricSubTitle : "Log in using your biometric"
},
electronIsEncryption: true,
electronWindowsLocation: "C:\\ProgramData\\CapacitorDatabases",
electronMacLocation: "/Volumes/Development_Lacie/Development/Databases",
electronLinuxLocation: "Databases"
}
}
};
export default config;
The plugin follows the guidelines from the Capacitor Team,
Meaning that it will not work in IE11 without additional JavaScript transformations, e.g. with Babel. You'll need the usual capacitor/android/react npm script to build and copy the assets folder.
sql-wasm.wasm from node_modules/sql.js/dist/sql-wasm.wasm to the src/assets folder of YOUR_APPsql-wasm.wasm from node_modules/sql.js/dist/sql-wasm.wasm to the public/assets folder of YOUR_APPWhen using the Web platform, SQLite databases are backed by jeep-sqlite and stored in IndexedDB, which can be difficult to inspect during development.
For easier debugging, there is a Chrome DevTools extension that allows browsing, querying, and exporting jeep-sqlite databases directly from IndexedDB:
x files found with path 'build-data.properties'.
You can add the following code to app/build.gradle: packagingOptions {
exclude 'build-data.properties'
}
See #301 and SO question for more information.
Check/Add the following: Gradle JDK version 21 Android Gradle Plugin Version 8.7.2 In variables.gradle
minSdkVersion = 23
compileSdkVersion = 35
targetSdkVersion = 35
In AndroidManifest.xml
<application
android:allowBackup="false"
android:fullBackupContent="false"
android:dataExtractionRules="@xml/data_extraction_rules"
In res/xml create a file data_extraction_rules.xml containing:
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="root" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</cloud-backup>
<device-transfer>
<exclude domain="root" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</device-transfer>
</data-extraction-rules>
cd electron
npm install --save better-sqlite3-multiple-ciphers
npm install --save electron-json-storage
npm install --save jszip
npm install --save node-fetch@2.6.7
npm install --save crypto
npm install --save crypto-js
npm install --save-dev @types/better-sqlite3
npm install --save-dev @types/electron-json-storage
npm install --save-dev @types/crypto-js
Important: node-fetch version must be <=2.6.7; otherwise you'll get an error running the app.
Important: if you are using @capacitor-community/electron v5
npm install --save-dev electron@25.8.4
npm uninstall --save-dev electron-rebuild
npm install --save-dev @electron/rebuild
npm install --save-dev electron-builder@24.6.4
tsconfig.json file and add "skipLibCheck": true,| Name | Android | iOS | Electron | Web |
|---|---|---|---|---|
| createConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
| createConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
| closeConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
| closeConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
| isConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
| isConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
| open (non-encrypted DB) | ✅ | ✅ | ✅ | ✅ |
| open (encrypted DB) | ✅ | ✅ | ✅ | ❌ |
| close | ✅ | ✅ | ✅ | ✅ |
| getUrl | ✅ | ✅ | ❌ | ❌ |
| getVersion | ✅ | ✅ | ✅ | ✅ |
| execute | ✅ | ✅ | ✅ | ✅ |
| executeSet | ✅ | ✅ | ✅ | ✅ |
| run | ✅ | ✅ | ✅ | ✅ |
| query | ✅ | ✅ | ✅ | ✅ |
| deleteDatabase | ✅ | ✅ | ✅ | ✅ |
| importFromJson | ✅ | ✅ | ✅ | ✅ |
| exportToJson | ✅ | ✅ | ✅ | ✅ |
| deleteExportedRows | ✅ | ✅ | ✅ | ✅ |
| createSyncTable | ✅ | ✅ | ✅ | ✅ |
| setSyncDate | ✅ | ✅ | ✅ | ✅ |
| getSyncDate | ✅ | ✅ | ✅ | ✅ |
| isJsonValid | ✅ | ✅ | ✅ | ✅ |
| isDBExists | ✅ | ✅ | ✅ | ✅ |
| addUpgradeStatement | ✅ | ✅ | ✅ | ✅ |
| copyFromAssets | ✅ | ✅ | ✅ | ✅ |
| isDBOpen | ✅ | ✅ | ✅ | ✅ |
| isDatabase | ✅ | ✅ | ✅ | ✅ |
| isTableExists | ✅ | ✅ | ✅ | ✅ |
| getTableList | ✅ | ✅ | ✅ | ✅ |
| getDatabaseList | ✅ | ✅ | ✅ | ✅ |
| getMigratableDbList | ✅ | ✅ | ❌ | ❌ |
| addSQLiteSuffix | ✅ | ✅ | ❌ | ❌ |
| deleteOldDatabases | ✅ | ✅ | ❌ | ❌ |
| moveDatabasesAndAddSuffix | ✅ | ✅ | ❌ | ❌ |
| checkConnectionsConsistency | ✅ | ✅ | ✅ | ✅ |
| isSecretStored | ✅ | ✅ | ✅ | ❌ |
| setEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
| changeEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
| clearEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
| checkEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
| initWebStore | ❌ | ❌ | ❌ | ✅ |
| saveToStore | ❌ | ❌ | ❌ | ✅ |
| getNCDatabasePath | ✅ | ✅ | ❌ | ❌ |
| createNCConnection | ✅ | ✅ | ❌ | ❌ |
| closeNCConnection | ✅ | ✅ | ❌ | ❌ |
| isNCDatabase | ✅ | ✅ | ❌ | ❌ |
| transaction | ✅ | ✅ | ✅ | ✅ |
| getFromHTTPRequest | ✅ | ✅ | ✅ | ✅ |
| isDatabaseEncrypted | ✅ | ✅ | ✅ | ❌ |
| isInConfigEncryption | ✅ | ✅ | ✅ | ❌ |
| isInConfigBiometricAuth | ✅ | ✅ | ❌ | ❌ |
| getFromLocalDiskToStore | ❌ | ❌ | ❌ | ✅ |
| saveToLocalDisk | ❌ | ❌ | ❌ | ✅ |
| beginTransaction | ✅ | ✅ | ✅ | ✅ |
| commitTransaction | ✅ | ✅ | ✅ | ✅ |
| rollbackTransaction | ✅ | ✅ | ✅ | ✅ |
| isTransactionActive | ✅ | ✅ | ✅ | ✅ |
Web ionic7-angular-sqlite-app Ionic 7 Angular 16 Capacitor 5 SQLite CRUD operations for Web.
Native ionic7-angular-sqlite-app Ionic 7 Angular 16 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
angular-sqlite-synchronize-app (Not Updated)
Web ionic7-react-sqlite-app Ionic7 React18.2.0 Vite4.3.9 Capacitor 5 SQLite CRUD operations for Web.
Web ionic7-react-sqlite-app Ionic7 React18.2.0 Vite4.3.9 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
Web ionic7-vue-sqlite-app Ionic7 Vue3.2.45 Vite4.3.9 Capacitor 5 SQLite CRUD operations for Web.
Web ionic7-vue-sqlite-app Ionic7 Vue3.2.45 Vite4.3.9 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
Web quasar-sqlite-app Quasar2.6.0 Capacitor 5 SQLite CRUD operations for Web.
Native quasar-sqlite-app Quasar2.6.0 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
The iOS and Android codes are using SQLCipher allowing for database encryption.
The iOS code is using ZIPFoundation for unzipping assets files
The Electron code is using better-sqlite3-multiple-ciphers , electron-json-storage and node-fetch from 5.0.4.
The Web code is using the Stencil component jeep-sqlite based on sql.js, localforage. and jszip
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
A big thank you to Jean Pierre Quéau, who maintained this plugin until version 6.0.0.
Overall
Maintained
Code review
Latest release
Releases this year
151 followers · starred Aug 2022
499 followers · starred Jun 2022
38 followers · starred May 2024
961 followers · starred Mar 2022
⚡Capacitor plugin for native & electron SQLite databases.
Swift
664
819 commits
updated Aug 6, 2026

@capacitor-community/sqlite
Capacitor community plugin for Native and Electron SQLite Databases. - In Native, databases could be encrypted with `SQLCipher` - In Electron, databases could be encrypted with `better-sqlite3-multiple-ciphers`
| Maintainer | Company | GitHub | Social |
|---|---|---|---|
| Robin Genz | Capawesome | robingenz | @robin_genz |
[!IMPORTANT]
This plugin uses the SQLCipher library (even for unencrypted databases), which is subject to the Encryption Export Regulations and may require you to submit a year-end self-classification report to the U.S. government. Read more here.
npm install --save @capacitor-community/sqlite
npx cap sync
yarn add @capacitor-community/sqlite
npx cap sync
pnpm install --save @capacitor-community/sqlite
pnpm install --save jeep-sqlite
pnpm install --save sql.js
npx cap sync
then add plugin to main capacitor.config.ts file:
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.jeep.app.ionic7.angular.sqlite',
appName: 'ionic7-angular-sqlite-starter',
webDir: 'www',
server: {
androidScheme: 'https'
},
plugins: {
CapacitorSQLite: {
iosDatabaseLocation: 'Library/CapacitorDatabase',
iosIsEncryption: true,
iosKeychainPrefix: 'angular-sqlite-app-starter',
iosBiometric: {
biometricAuth: false,
biometricTitle : "Biometric login for capacitor sqlite"
},
androidIsEncryption: true,
androidBiometric: {
biometricAuth : false,
biometricTitle : "Biometric login for capacitor sqlite",
biometricSubTitle : "Log in using your biometric"
},
electronIsEncryption: true,
electronWindowsLocation: "C:\\ProgramData\\CapacitorDatabases",
electronMacLocation: "/Volumes/Development_Lacie/Development/Databases",
electronLinuxLocation: "Databases"
}
}
};
export default config;
The plugin follows the guidelines from the Capacitor Team,
Meaning that it will not work in IE11 without additional JavaScript transformations, e.g. with Babel. You'll need the usual capacitor/android/react npm script to build and copy the assets folder.
sql-wasm.wasm from node_modules/sql.js/dist/sql-wasm.wasm to the src/assets folder of YOUR_APPsql-wasm.wasm from node_modules/sql.js/dist/sql-wasm.wasm to the public/assets folder of YOUR_APPWhen using the Web platform, SQLite databases are backed by jeep-sqlite and stored in IndexedDB, which can be difficult to inspect during development.
For easier debugging, there is a Chrome DevTools extension that allows browsing, querying, and exporting jeep-sqlite databases directly from IndexedDB:
x files found with path 'build-data.properties'.
You can add the following code to app/build.gradle: packagingOptions {
exclude 'build-data.properties'
}
See #301 and SO question for more information.
Check/Add the following: Gradle JDK version 21 Android Gradle Plugin Version 8.7.2 In variables.gradle
minSdkVersion = 23
compileSdkVersion = 35
targetSdkVersion = 35
In AndroidManifest.xml
<application
android:allowBackup="false"
android:fullBackupContent="false"
android:dataExtractionRules="@xml/data_extraction_rules"
In res/xml create a file data_extraction_rules.xml containing:
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="root" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</cloud-backup>
<device-transfer>
<exclude domain="root" />
<exclude domain="database" />
<exclude domain="sharedpref" />
<exclude domain="external" />
</device-transfer>
</data-extraction-rules>
cd electron
npm install --save better-sqlite3-multiple-ciphers
npm install --save electron-json-storage
npm install --save jszip
npm install --save node-fetch@2.6.7
npm install --save crypto
npm install --save crypto-js
npm install --save-dev @types/better-sqlite3
npm install --save-dev @types/electron-json-storage
npm install --save-dev @types/crypto-js
Important: node-fetch version must be <=2.6.7; otherwise you'll get an error running the app.
Important: if you are using @capacitor-community/electron v5
npm install --save-dev electron@25.8.4
npm uninstall --save-dev electron-rebuild
npm install --save-dev @electron/rebuild
npm install --save-dev electron-builder@24.6.4
tsconfig.json file and add "skipLibCheck": true,| Name | Android | iOS | Electron | Web |
|---|---|---|---|---|
| createConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
| createConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
| closeConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
| closeConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
| isConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
| isConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ |
| open (non-encrypted DB) | ✅ | ✅ | ✅ | ✅ |
| open (encrypted DB) | ✅ | ✅ | ✅ | ❌ |
| close | ✅ | ✅ | ✅ | ✅ |
| getUrl | ✅ | ✅ | ❌ | ❌ |
| getVersion | ✅ | ✅ | ✅ | ✅ |
| execute | ✅ | ✅ | ✅ | ✅ |
| executeSet | ✅ | ✅ | ✅ | ✅ |
| run | ✅ | ✅ | ✅ | ✅ |
| query | ✅ | ✅ | ✅ | ✅ |
| deleteDatabase | ✅ | ✅ | ✅ | ✅ |
| importFromJson | ✅ | ✅ | ✅ | ✅ |
| exportToJson | ✅ | ✅ | ✅ | ✅ |
| deleteExportedRows | ✅ | ✅ | ✅ | ✅ |
| createSyncTable | ✅ | ✅ | ✅ | ✅ |
| setSyncDate | ✅ | ✅ | ✅ | ✅ |
| getSyncDate | ✅ | ✅ | ✅ | ✅ |
| isJsonValid | ✅ | ✅ | ✅ | ✅ |
| isDBExists | ✅ | ✅ | ✅ | ✅ |
| addUpgradeStatement | ✅ | ✅ | ✅ | ✅ |
| copyFromAssets | ✅ | ✅ | ✅ | ✅ |
| isDBOpen | ✅ | ✅ | ✅ | ✅ |
| isDatabase | ✅ | ✅ | ✅ | ✅ |
| isTableExists | ✅ | ✅ | ✅ | ✅ |
| getTableList | ✅ | ✅ | ✅ | ✅ |
| getDatabaseList | ✅ | ✅ | ✅ | ✅ |
| getMigratableDbList | ✅ | ✅ | ❌ | ❌ |
| addSQLiteSuffix | ✅ | ✅ | ❌ | ❌ |
| deleteOldDatabases | ✅ | ✅ | ❌ | ❌ |
| moveDatabasesAndAddSuffix | ✅ | ✅ | ❌ | ❌ |
| checkConnectionsConsistency | ✅ | ✅ | ✅ | ✅ |
| isSecretStored | ✅ | ✅ | ✅ | ❌ |
| setEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
| changeEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
| clearEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
| checkEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
| initWebStore | ❌ | ❌ | ❌ | ✅ |
| saveToStore | ❌ | ❌ | ❌ | ✅ |
| getNCDatabasePath | ✅ | ✅ | ❌ | ❌ |
| createNCConnection | ✅ | ✅ | ❌ | ❌ |
| closeNCConnection | ✅ | ✅ | ❌ | ❌ |
| isNCDatabase | ✅ | ✅ | ❌ | ❌ |
| transaction | ✅ | ✅ | ✅ | ✅ |
| getFromHTTPRequest | ✅ | ✅ | ✅ | ✅ |
| isDatabaseEncrypted | ✅ | ✅ | ✅ | ❌ |
| isInConfigEncryption | ✅ | ✅ | ✅ | ❌ |
| isInConfigBiometricAuth | ✅ | ✅ | ❌ | ❌ |
| getFromLocalDiskToStore | ❌ | ❌ | ❌ | ✅ |
| saveToLocalDisk | ❌ | ❌ | ❌ | ✅ |
| beginTransaction | ✅ | ✅ | ✅ | ✅ |
| commitTransaction | ✅ | ✅ | ✅ | ✅ |
| rollbackTransaction | ✅ | ✅ | ✅ | ✅ |
| isTransactionActive | ✅ | ✅ | ✅ | ✅ |
Web ionic7-angular-sqlite-app Ionic 7 Angular 16 Capacitor 5 SQLite CRUD operations for Web.
Native ionic7-angular-sqlite-app Ionic 7 Angular 16 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
angular-sqlite-synchronize-app (Not Updated)
Web ionic7-react-sqlite-app Ionic7 React18.2.0 Vite4.3.9 Capacitor 5 SQLite CRUD operations for Web.
Web ionic7-react-sqlite-app Ionic7 React18.2.0 Vite4.3.9 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
Web ionic7-vue-sqlite-app Ionic7 Vue3.2.45 Vite4.3.9 Capacitor 5 SQLite CRUD operations for Web.
Web ionic7-vue-sqlite-app Ionic7 Vue3.2.45 Vite4.3.9 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
Web quasar-sqlite-app Quasar2.6.0 Capacitor 5 SQLite CRUD operations for Web.
Native quasar-sqlite-app Quasar2.6.0 Capacitor 5 SQLite CRUD operations for iOS, Android and Electron.
The iOS and Android codes are using SQLCipher allowing for database encryption.
The iOS code is using ZIPFoundation for unzipping assets files
The Electron code is using better-sqlite3-multiple-ciphers , electron-json-storage and node-fetch from 5.0.4.
The Web code is using the Stencil component jeep-sqlite based on sql.js, localforage. and jszip
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
A big thank you to Jean Pierre Quéau, who maintained this plugin until version 6.0.0.
Overall
Maintained
Code review
Latest release
Releases this year
151 followers · starred Aug 2022
499 followers · starred Jun 2022
38 followers · starred May 2024
961 followers · starred Mar 2022