GithubHelp home page GithubHelp logo

medeasolution / sqlite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from capacitor-community/sqlite

0.0 1.0 0.0 34.23 MB

Community plugin for native & electron SQLite databases

License: MIT License

Ruby 0.15% Java 33.91% Swift 39.21% Objective-C 0.40% JavaScript 0.15% TypeScript 26.18%

sqlite's Introduction


SQLITE DATABASE

@capacitor-community/sqlite


CAPACITOR 3


Capacitor community plugin for Native and Electron SQLite Databases. In Native databases could be encrypted with SQLCipher



Maintainers

Maintainer GitHub Social
Quรฉau Jean Pierre jepiqueau

CAPACITOR 3 (Master)

๐Ÿšจ Since release 3.2.0-5 ->> ๐Ÿšจ

The Web plugin is now implemented based on the stencil companion [email protected] which is using [email protected] for database queries and [email protected]for database persistency.

๐Ÿšจ Since release 3.2.0-3 ->> ๐Ÿšจ

The Electron plugin is now based on @capacitor-community/[email protected] thanks to the hard and heavy work from Mike Summerfeldt IT-MikeS ๐Ÿ‘ ๐Ÿ™

๐Ÿšจ Since release 3.2.0-2 ->> ๐Ÿšจ ๐Ÿšจ !!! for Electron developper, the Electron plugin is back !!! ๐Ÿšจ

Based on sqlite3, so without encryption The two listeners sqliteImportProgressEvent and sqliteExportProgressEvent are not available.

๐Ÿšจ Since release 3.1.2 ->> ๐Ÿšจ

Thanks to Nirajhinge and Chris, an example of using the TypeORM driver in a Ionic/Vue app has been developed see https://github.com/jepiqueau/vue-typeorm-app.

๐Ÿšจ Since release 3.0.0-rc.2 ->> ๐Ÿšจ

Thanks to Chris, a driver to TypeORM is now available

๐Ÿšจ Since release 3.0.0-beta.13 ->> ๐Ÿšจ

  • GlobalSQLite secret and newsecret are deprecated

  • The user can now set its own secure secret (passphrase)

    • use setEncryptionSecret ONCE to migrate encrypted databases from secret to secure stored secret

    • use changeEncryptionSecret to change your secure stored secret

  • iOS used KeyChain service to store the secret

  • Android used Encrypted SharedPreferences to store the secret, the minimun sdk should be set to 23 (limitation from Google)

๐Ÿšจ Since release 3.0.0-beta.13 ->> ๐Ÿšจ

๐Ÿšจ Since release 3.0.0-beta.11 ->> ๐Ÿšจ

  • Checking of types has been removed in all methods of the plugin both iOS & Android. This has been achieved to allow the use of others RDBMS types. The type checking is now under the responsability of the developers.

  • NULL values are now returned as null

  • values for the query method is now an Array of any.

  • option to disable transaction for the execute, executeSet, run.

๐Ÿšจ Since release 3.0.0-beta.11 <<- ๐Ÿšจ

The test has been achieved on:

REFACTOR (Move to branch 2.9.x)

The 2.9.x is now ๐Ÿ›‘ NOT MAINTAINED ANYMORE ๐Ÿ›‘.

The refactor offers now (since 2.9.0-beta.1) all the features that the previous was offering. It has been a quite heavy process, hoping that the developpers will take benefit from it.

The main reasons for it:

  • multiple database connections
  • db connector allowing for easy commands db.open(), db.close, ...
  • improve the response time of the encrypted database by removing the internal open and close database for each sqlite query
  • moving to the latest androidx.sqlite.db.xxx
  • offering encryption for Electron platform by using @journeyapps/sqlcipher on MacOs, !!! NOT ON WINDOWS !!!
  • cleaning and aligning the code between platforms
  • allowing developers to develop typeorm or spatialite drivers.

This was discussed lengthly in issue#1 and issue#52

Refactor available for Android, iOS and Electron platforms.

The test has been achieved on:

Other frameworks will be tested later

  • Stencil

@INITIAL ๐Ÿ›‘ (Move to branch 2.4.x)

The 2.4.x is now ๐Ÿ›‘ NOT MAINTAINED ANYMORE ๐Ÿ›‘.

To install it

npm i --save @capacitor-community/sqlite@initial

The test has been achieved on:

Browser Support

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.

Installation

npm install @capacitor-community/sqlite
npm run build
npx cap add android
npx cap add ios
npx cap add @capacitor-community/electron

and do when you update

npx cap sync
npx cap sync @capacitor-community/electron

Web

For Angular framework

  • copy manually the file sql-wasm.wasm from nodes_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 nodes_modules/sql.js/dist/sql-wasm.wasm to the public/assets folder of YOUR_APP

IOS

  • on iOS, no further steps needed.

Android

  • On Android, no further steps needed.

Electron

  • On Electron, go to the Electron folder of YOUR_APPLICATION
cd electron
npm install --save sqlite3
npm install --save-dev @types/sqlite3
npm run build

Build & Run

npm run build
npx cap copy
npx cap copy web
npx cap copy @capacitor-community/electron

Web

  • Angular
ionic serve
  • Vue
npm run serve
  • React
npm run start

IOS

npx cap open ios

Android

npx cap open android

Electron

npx cap open @capacitor-community/electron

Issues

issues

Configuration

No configuration required for this plugin

Supported methods

Name Android iOS Electron Web
createConnection โœ… โœ… โœ… โœ…
closeConnection โœ… โœ… โœ… โœ…
isConnection โœ… โœ… โœ… โœ…
open (non-encrypted DB) โœ… โœ… โœ… โœ…
open (encrypted DB) โœ… โœ… โŒ โŒ
close โœ… โœ… โœ… โœ…
getVersion โœ… โœ… โœ… โœ…
execute โœ… โœ… โœ… โœ…
executeSet โœ… โœ… โœ… โœ…
run โœ… โœ… โœ… โœ…
query โœ… โœ… โœ… โœ…
deleteDatabase โœ… โœ… โœ… โœ…
importFromJson โœ… โœ… โœ… โœ…
exportToJson โœ… โœ… โœ… โœ…
createSyncTable โœ… โœ… โœ… โœ…
setSyncDate โœ… โœ… โœ… โœ…
getSyncDate โœ… โœ… โœ… โœ…
isJsonValid โœ… โœ… โœ… โœ…
isDBExists โœ… โœ… โœ… โœ…
addUpgradeStatement โœ… โœ… โœ… โœ…
copyFromAssets โœ… โœ… โœ… โœ…
isDBOpen โœ… โœ… โœ… โœ…
isDatabase โœ… โœ… โœ… โœ…
isTableExists โœ… โœ… โœ… โœ…
getDatabaseList โœ… โœ… โœ… โœ…
addSQLiteSuffix โœ… โœ… โŒ โŒ
deleteOldDatabases โœ… โœ… โŒ โŒ
checkConnectionsConsistency โœ… โœ… โœ… โœ…
isSecretStored โœ… โœ… โŒ โŒ
setEncryptionSecret โœ… โœ… โŒ โŒ
changeEncryptionSecret โœ… โœ… โŒ โŒ

Supported SQLite Types

-Datatypes In SQLite Version 3

Documentation

API

Framework's Usage

Applications demonstrating the use of the plugin

Ionic/Angular

Ionic/React

Ionic/Vue

Vue

Usage

Dependencies

The IOS and Android codes are using SQLCipher allowing for database encryption. The Electron code is using sqlite3. The Web code is using the Stencil component jeep-sqlite based on sql.js and localforage.

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Jean Pierre Quรฉau

๐Ÿ’ป

Paul Antoine

๐Ÿ’ป

Karyfars

๐Ÿ’ป

Chriswep

๐Ÿ“–

Nirajhinge

๐Ÿ’ป

Dirk Gausmann

๐Ÿ’ป

Mike Summerfeldt

๐Ÿ’ป

Peakcool

๐Ÿ’ป

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

sqlite's People

Contributors

chriswep avatar digaus avatar jepiqueau avatar lovetodream avatar mhartington avatar paulantoine2 avatar rubickecho avatar

Watchers

 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.