Git Product home page Git Product logo

sqlite's Introduction


SQLITE DATABASE

@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 <<- ๐Ÿšจ

Maintainers

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

More Reading:

Web Quirks

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.

For Angular framework

  • Copy manually the file sql-wasm.wasm from node_modules/sql.js/dist/sql-wasm.wasm to the src/assets folder of YOUR_APP

For Vue & React frameworks

  • Copy manually the file sql-wasm.wasm from node_modules/sql.js/dist/sql-wasm.wasm to the public/assets folder of YOUR_APP

Android Quirks

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.

Electron Quirks

  • 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

IOS Quirks

  • on iOS, no further steps needed.

Supported Methods by Platform

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 โœ… โœ… โœ… โœ…

Documentation & APIs

Applications demonstrating the use of the plugin and related documentation

Ionic/Angular

Ionic/React

React+Vite

Ionic/Vue

Vue

Vue+Vite

SolidJS+Vite

Vue TypeORM app

Dependencies

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

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

sqlite's People

Contributors

jepiqueau avatar dragermrb avatar tobiasmuecksch avatar harelm avatar chriswep avatar mhartington avatar dependabot[bot] avatar gion-andri avatar joewoodhouse avatar rdlabo avatar victorybiz avatar dewald-els avatar eltociear avatar lovetodream avatar composoftware-phonegap avatar digaus avatar iamcco avatar paulantoine2 avatar rubickecho avatar ptasheq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.