libSQL 0.1.0 release notes
The libSQL team is pleased to announce libSQL 0.1.0!
This release comes with the following features and fixes:
CREATE FUNCTION: support for WebAssembly user-defined functions
User-defined functions are here, available straight from SQL! The new CREATE FUNCTION
and DROP FUNCTION
syntax allows to manage functions dynamically right from the SQL interpreter, without having to register them via any API calls.
Support for user-defined functions is experimental and needs to be explicitly enabled via configure:
./configure --enable-wasm-runtime
.
WebAssembly is a compiled language, so with the release come helper projects to make creating new user-defined functions easy:
- https://bindgen.libsql.org/
an interactive playground for compiling Rust code to WebAssembly user-defined functions for libSQL - https://github.com/libsql/libsql_generate
source-code for the playground above - https://crates.io/crates/libsql_bindgen
a Rust crate used to transform native Rust code to WebAssembly user-defined functions for libSQL
Current implementation runs on Wasmtime and can be compiled either as a separate dynamic library, or as monolith. The support is implemented directly in Wasmtime’s native language — Rust — and linked with existing C code. Next on our plate: integration with V8) API as well as WasmEdge, [Wasmer.io](http://wasmer.io/) and more!
New test suite
SQLite is famous for its extensive test coverage, which is the foundation of its robustness and reliability. Existing SQLite tests are already part of our continuous integration. What’s less broadly known is that one of the test suites providing 100% branch coverage to SQLite — TH3 — is proprietary.
In libSQL we insist on making the whole source code available, tests included, and that’s why we added yet another test suite to the pack. SQLite OSS tests are written in Tcl. We are not experts in Tcl, so the new suite is based on the Rust toolchain.
We acknowledge that this test suite is not extensive as TH3, but we do plan to work towards it, and your contributions for new tests are always welcome! The new suite is available at test/rust_suite. If you are new to libSQL, and want to contribute, that’s a great start.
optimization of ext/wasm build
ext/wasm extension allows building libSQL to Wasm. It's a fantastic initiative kickstarted back at SQLite. We applied a few rounds of optimization on top of the project to make it even more lightweight and fast - reducing the module size from over 3MiB to less than 1MiB. A preview for the optimized playground application is hosted here: https://playground.libsql.org/.
RANDOM ROWID
Tables can now be created with an additional RANDOM ROWID directive, which switches the rowid generation algorithm from sequential numbers to trying pseudorandom values until an available one is found. This feature was requested in context of mvSQLite, a distributed SQLite-compatible database, where sequential row ids are much more likely to cause contention with multiple writers.
Lots of fixes and amendments
- improved
make clean
to cover more files - added explicit I/O flush in
iotrace
mode - added a
.gitignore
file - dropped
.fossil-settings
- and more!
Contributions
libSQL is not only Open-Source, but also Open-Contribution. Huge kudos to all contributors, thanks for making this release happen!