Golem add turso rust

From golemcloud/golem · View interactive version

Golem add turso rust is an AI agent skill from the GitHub repository golemcloud/golem. Use the Turso Rust crate for an in-memory embedded SQL database in a Rust Golem agent. Use when asking for Turso, local Turso SQL, or the proven WASI-compatible Turso configuration.

How to use this skill

Skill file

Using In-Memory Turso from Rust

The currently proven configuration runs Turso's pure-Rust in-memory database inside a

wasm32-wasip2 Golem agent. It proves local SQL execution, not Turso Cloud connectivity,

file-backed persistence, or automatic database snapshotting.

Add the dependency

Disable default features; they include native-oriented functionality that this use case does not

need:

[dependencies]
turso = { version = "=0.8.0-pre.11", default-features = false }

Turso 0.8.0-pre.11 is a prerelease and does not claim WASI Preview 2 as a supported target. Pin

the exact version and retest builds and runtime behavior before upgrading.

Proven pattern

use golem_rust::{agent_definition, agent_implementation};

#[agent_definition(ephemeral)]
pub trait TursoAgent {
    fn new(name: String) -> Self;
    async fn round_trip(&self, value: String) -> String;
}

struct TursoAgentImpl;

#[agent_implementation]
impl TursoAgent for TursoAgentImpl {
    fn new(_name: String) -> Self {
        Self
    }

    async fn round_trip(&self, value: String) -> String {
        let database = turso::Builder::new_local(":memory:")
            .with_io(turso::IoBackend::Memory)
            .build()
            .await
            .expect("failed to create in-memory Turso database");
        let connection = database.connect().expect("failed to connect to Turso");

        connection
            .execute(
                "CREATE TABLE messages (id INTEGER PRIMARY KEY, value TEXT NOT NULL)",
                (),
            )
            .await
            .expect("failed to create table");
        connection
            .execute("INSERT INTO messages (value) VALUES (?1)", [value])
            .await
            .expect("failed to insert row");

        let mut rows = connection
            .query("SELECT value FROM messages WHERE id = 1", ())
            .await
            .expect("failed to query row");
        let row = rows
            .next()
            .await
            .expect("failed to read row")
            .expect("query returned no row");
        row.get(0).expect("failed to decode value")
    }
}

Limitations

results, caches, and the agent itself share the account's per-agent memory limit. Inspect it with

golem account limits show.

durable database state, recovery, file-backed Turso, or remote Turso service access.

agent depends on. Prefer embedded SQLite for the documented file-backed and snapshot-integrated

paths, or an external database for shared data.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.