Module libsql::wasm

source ·
Available on crate feature wasm only.
Expand description

This module contains a special Connection struct that can be used in constrained wasm environments. This struct is separate from the main connection struct in the root of the crate due to the nature of some wasm clients requiring !Send/!Sync support.

To use these connections in wasm, you must disable default features then enable the backend below that you would like.

Currently implemented wasm http backends are:

Example Cargo.toml

[packages]
libsql = { version = "*", default-features = false, features = ["cloudflare"] }

Example Rust usage

use libsql::wasm::Connection;

let conn = Connection::open_cloudflare_worker("libsql://my-turso-db.turso.io", "my-auth-token");

conn.execute("select 1", ()).await?;
conn.query("select 1", ()).await?;

Structs