@capacitor-community/sqlite
CAPACITOR 4
Capacitor community plugin for Native and Electron SQLite Databases. In Native databases could be encrypted with SQLCipher
๐จ Release 4.2.2-1 ->> ๐จ
Please do not use it. it was a trial to implement BEGIN CONCURRENCY in Electron Platform to fix issue #258. It seems that sqlite3 does not offer this feature as well as PRAGMA journal_mode= wal2
If someone got some ideas on this, he is welcome.
๐จ Release 4.2.2-1 <<- ๐จ
Maintainer | GitHub | Social |
---|---|---|
Quรฉau Jean Pierre | jepiqueau |
To install:
npm install --save @capacitor-community/sqlite
npx cap sync
yarn install --save @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
- Releases
- Changelog
- Issues
- Capacitor documentation
- Datatypes In SQLite Version 3
- IncrementalUpgradeDatabaseVersion
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.
- Copy manually the file
sql-wasm.wasm
fromnode_modules/sql.js/dist/sql-wasm.wasm
to thesrc/assets
folder of YOUR_APP
- Copy manually the file
sql-wasm.wasm
fromnode_modules/sql.js/dist/sql-wasm.wasm
to thepublic/assets
folder of YOUR_APP
In case you get the following error when building your app in Android Studio:
x files found with path 'build-data.properties'.
You can you add the following code to app/build.gradle
:
packagingOptions {
exclude 'build-data.properties'
}
See #301 and SO question for more information.
- On Electron, go to the Electron folder of YOUR_APPLICATION
cd electron
npm install --save sqlite3
npm install --save jszip
npm install --save node-fetch
npm install --save-dev @types/sqlite3
- on iOS, no further steps needed.
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 | โ | โ | โ | โ |
initWebStore | โ | โ | โ | โ |
saveToStore | โ | โ | โ | โ |
getNCDatabasePath | โ | โ | โ | โ |
createNCConnection | โ | โ | โ | โ |
closeNCConnection | โ | โ | โ | โ |
isNCDatabase | โ | โ | โ | โ |
transaction | โ | โ | โ | โ |
getFromHTTPRequest | โ | โ | โ | โ |
The iOS and Android codes are using SQLCipher
allowing for database encryption.
The iOS codes is using ZIPFoundation
for unzipping assets files
The Electron code is using sqlite3
and node-fetch
from 4.2.0.
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!