1.0.11 ā€¢ Published 2 years ago

fieldservice-sqlite-fat v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Maintainer

MaintainerGitHubSocial
Capacitor Community(https://www.npmjs.com/package/@capacitor-community/sqlite)

CAPACITOR 3 (Master)

šŸšØ Since release 3.2.5-2 ->> šŸšØ

  • support zip file in copyFromAssets method
  • add optional overwrite parameter (true/false) default to true

šŸšØ Since release 3.2.5-2 <<- šŸšØ

šŸšØ Since release 3.2.3-1 ->> šŸšØ

The initWebStore and saveToStore methods have been added to the Web platform.

  • The initWebStore has been added to fix the issue#172 and since then is MANDATORY
    ...
    if(platform === "web") {
      await customElements.whenDefined('jeep-sqlite');
      const jeepSqliteEl = document.querySelector('jeep-sqlite');
      if(jeepSqliteEl != null) {
        await sqliteConnection.initWebStore()
        ...
      }
    }
    ...
  • the saveToStore allows to perform intermediate save of the database in case the browser needs to delete the cache.

šŸšØ Since release 3.2.3-1 <<- šŸšØ

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 jszip
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

Readme previous releases

previous releases

Issues

issues

Configuration

No configuration required for this plugin

Supported methods

NameAndroidiOSElectronWeb
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āœ…āœ…āœ…āœ…
getMigratableDbListāœ…āœ…āŒāŒ
addSQLiteSuffixāœ…āœ…āŒāŒ
deleteOldDatabasesāœ…āœ…āŒāŒ
checkConnectionsConsistencyāœ…āœ…āœ…āœ…
isSecretStoredāœ…āœ…āŒāŒ
setEncryptionSecretāœ…āœ…āŒāŒ
changeEncryptionSecretāœ…āœ…āŒāŒ
initWebStoreāŒāŒāŒāœ…
saveToStoreāŒāŒāŒāœ…

Supported SQLite Types

-Datatypes In SQLite Version 3

Documentation

API

Framework's Usage

Applications demonstrating the use of the plugin

Ionic/Angular

Ionic/React

React+Vite

Ionic/Vue

Vue

Vue+Vite

Usage

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. The Web code is using the Stencil component jeep-sqlite based on sql.js, localforage. and jszip

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago