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
andeach
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.
The demo is available here.
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
The latest version was built on:
Linux Debian 10 x64
emcc 1.38.47 (commit 9ed207099a0845654a008872378c4054cc6a56ea)
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 ..
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 ..
cd websql
git submodule update --init --recursive
yarn
yarn build
yarn demo
Thanks to the following people for their original work on sql.js:
- Ophir LOJKINE pere.jobs@gmail.com (https://github.com/lovasoa)
- @kripken
- @hankinsoft
- @firien
- @dinedal
- @taytay