https://github.com/libsql/libsql_bindgen
https://github.com/libsql/libsql_bindgen
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/libsql/libsql_bindgen
- Owner: libsql
- Created: 2022-10-12T16:16:53.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-03T09:23:04.000Z (about 2 years ago)
- Last Synced: 2025-04-13T15:12:48.237Z (2 months ago)
- Language: Rust
- Size: 12.4 MB
- Stars: 20
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.A generic example:
https://github.com/psarna/libsql_bindgen/blob/master/examples/encrypt_decrypt/src/lib.rsTry it yourself:
```
cd examples/encrypt_decrypt
./get_sql.sh encrypt
./get_sql.sh decrypt
```There are also [advanced examples that require WasmEdge](examples/wasmedge) to run:
* [Call external HTTPS web services from a UDF](examples/wasmedge/get_exchange_rate)
* [Classify image fields using a PyTorch model](examples/wasmedge/wasi_nn_udf)This repository is the foundation of [libSQL generate](https://github.com/psarna/libsql_generate) and http://bindgen.libsql.org/