tursodatabase / tursodatabase/libsql
Implement libsql_bindgen in Rust for interoperability between libSQL and WebAssembly
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 17.2k
- Forks
- 531
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 1
Description
WebAssembly modules are seldom coded by hand. Instead, Rust, C++, AssemblyScript and any other language compilable to Wasm is used for that purpose. In order to facilitate creating user-defined functions in Rust that work properly with libSQL types (https://www.sqlite.org/datatype3.html), we should create a crate which exposes a libsql_bindgen macro. This macro can take care of translating Rust types directly into something that libSQL understands, which would allow users to write user-defined functions for libSQL in native Rust.
Example (pseudo-Rust, subject to change):
#[libsql_bindgen]
fn append_42(input: String) -> String {
input + "_42"
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed libsql_bindgen crate and the pseudo-Rust append_42 example in the issue; the payload names no existing files or tests. Define what Rust types must map to libSQL types and what the macro's supported interface should be, then verify that the example can be used for a WebAssembly user-defined function.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite, wasm
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100