#webassembly #libsql #sqlite #wasm #udf

libsql_bindgen

Rust library for writing WebAssembly-powered user-defined functions for libSQL

15 releases

0.3.1 Mar 18, 2023
0.3.0 Mar 17, 2023
0.2.6 Nov 22, 2022
0.1.5 Nov 2, 2022

#258 in WebAssembly

Download history 1/week @ 2022-12-08 13/week @ 2022-12-15 3/week @ 2022-12-22 6/week @ 2022-12-29 4/week @ 2023-01-05 8/week @ 2023-01-12 7/week @ 2023-01-19 9/week @ 2023-01-26 1/week @ 2023-02-02 30/week @ 2023-02-09 37/week @ 2023-02-16 1/week @ 2023-02-23 2/week @ 2023-03-02 2/week @ 2023-03-09 68/week @ 2023-03-16 5/week @ 2023-03-23

78 downloads per month

MIT/Apache

6KB
102 lines

Intro

This repository contains a helper library for coding WebAssembly-powered user-defined functions for libSQL.

Marking a native Rust function with #[libsql_bindgen] macro and compiling it to wasm32-unknown-unknown target is enough to produce a user-defined function definition callable directly from libSQL.

Example: https://github.com/psarna/libsql_bindgen/blob/master/examples/encrypt_decrypt/src/lib.rs

Try it yourself:

cd examples/encrypt_decrypt
./get_sql.sh encrypt
./get_sql.sh decrypt

This repository is the foundation of libSQL generate and http://bindgen.libsql.org/

Dependencies

~0.7–1.1MB
~27K SLoC