Giter Site home page Giter Site logo

fdt2k / websql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from acrop/websql

0.0 2.0 0.0 2.84 MB

Encrypted SQLite database for the browser and Node.js

Home Page: https://npmjs.com/package/@wireapp/websql

License: GNU General Public License v3.0

Makefile 1.63% TypeScript 37.81% JavaScript 25.21% C 34.67% Shell 0.30% HTML 0.38%

websql's Introduction

websql

Build Status

Currently WIP

websql is a fork of sql.js with some changes:

  • Uses sqleet which is SQLite with encryption enabled
  • Database is persisted to IndexedDB, and can be synced using the saveChanges API
  • WASM file is embed within the library so no need to worry about locateFile
  • Use of Shared Worker (with MessageChannel and postMessage)
  • Slightly different but easier API
  • The API uses a transparent proxy so you don't need to deal with the Shared Worker communication
  • createFunction and each has been removed from the API
  • Removed old code related to ASM, only using WASM now
  • Migrated Coffeescript API to Typescript
  • Uses more modern build mechanisms

Note: No Shared Worker support means currently:

  • Degraded support in Safari (use of Web Workers which does not allow multi-window env)
  • Degraded support in Edge 18 and below (use of Pseudo Web Worker which runs in the main thread and does not allow multi-window env as Edge does not support window.crypto nor IndexedDB inside Workers) (Note that Edge 77 Beta supports Shared Worker as it is based on Chromium)

SQLite is under public domain, sql.js is MIT licensed and websql is GNU licensed.

Demo

The demo is available here.

Usage

No API docs yet. But you can check out the demo file here.

NOTHING is now a reserved word in SQLite, whereas previously it was not. This could cause errors like Error: near "nothing": syntax error

Compiling & Installation

The latest version was built on:

Linux Debian 10 x64
emcc 1.38.47 (commit 9ed207099a0845654a008872378c4054cc6a56ea)

Install emsdk

macOS

brew install python2 && brew link python2
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
brew cask install java
./emsdk activate latest
source ./emsdk_env.sh
cd ..

Linux

sudo apt-get install python3 default-jre
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ..

Compile websql

cd websql
git submodule update --init --recursive
yarn
yarn build

Run demo server

yarn demo

Thanks

Thanks to the following people for their original work on sql.js:

websql's People

Contributors

ffflorian avatar dependabot-preview[bot] avatar bennycode avatar

Watchers

James Cloos avatar  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.