Home

Awesome

WebSQL Client

Bower version

NPM

websql-server exposes a sqlite API originally defined at Cordova-SQLitePlugin through Websockets.

websql-client connects to websql-server and implements the WebSQL API.

Usage

Install websql-server:

npm install -g websql-server

Start websql-server:

websql-server

Import websql-client (a bower package) and primus in your html (Primus is automatically served by websql-server):

<script src="bower_components/websql-client/dist/websql-client.js"></script>
<script src="http://localhost:8082/primus/primus.js"></script>

Include the initialization code:

var db = window.sqlitePlugin.openDatabase({name: "my.db", location: 1});

A more advanced installation would conditionally load websql-client if a browser environment is detected, otherwise load Cordova-SQLitePlugin.

Testing

Running tests in the web browser

serve up the whole project as a static site with: http-server (npm package)

navigate to: http://localhost:8080/test/browser/tests/index.html

Intended Use cases

Advantages over using browser's Built in WebSQL implementations: