SQLite compiled to WebAssembly
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 25 commits ahead, 17 commits behind mandel59:master.
Latest commit bb7bd04 Oct 16, 2018

README.md

SQLite compiled to WebAssembly for the Uno Wasm Bootstrapper

This repository is about building the SQLite library to WebAssembly, and use it as a Nuget package in an application using the Uno.Wasm.Bootstrap.

It is primarily made for the Uno.SQLiteNet package.

This repository is based on the work from Ryusei YAMAGUCHI.

Architecture

This package exposes the native APIs of the SQLite API to be consumed by other libraries expecting this same C API. It can be used as follows:

var SQLiteNative = require('sqlite3');

var res = SQLiteNative.Database.open(fileName, null, { mode: "rwc", cache: "private" });

// Call other apis...

if(res.Code == 0){
  var result = SQLiteNative.Database.close_v2(res.pDB, true);
}

This packages is built around the MODULARIZE_INSTANCE feature of Emscripten, to avoid instance clashes with the Module class of of other emscripten built libraries (particularly Mono-wasm).

For the same reason, the file system is currently restricted to this module, meaning that the Database.open API allows for providing a database using an UInt8Array version of a file. The close API provides a way for getting this file back as a memory array.

TODO

  • Support for VFS persistence configuration
  • Enable Emscripten -O3
  • Implement all the native APIs
  • Unit Tests

Related