Working samples for every language that embeds the SQLRite engine.
Phase 5 lands these incrementally — each sub-phase fills in one language. The directory layout is designed so new SDKs slot in cleanly without disturbing the existing ones.
| Language | Status | SDK published | Directory |
|---|---|---|---|
| Rust | ✅ Phase 5a | crates.io as sqlrite-engine (Phase 6d) |
rust/ |
| C (FFI) | ✅ Phase 5b | GitHub Releases (Phase 6d) | c/ |
| Python | ✅ Phase 5c | PyPI as sqlrite (Phase 6f) |
python/ |
| Node.js | ✅ Phase 5d | npm as @joaoh82/sqlrite (Phase 6g) |
nodejs/ |
| Go | ✅ Phase 5e | Go modules (Phase 6i) | go/ |
| WASM | ✅ Phase 5g | npm as @joaoh82/sqlrite-wasm (Phase 6h) |
wasm/ |
| MCP | ✅ Phase 7h | crates.io as sqlrite-mcp + per-platform binary tarballs |
(no examples/ subdir — see docs/mcp.md for the full quickstart with Claude Code / Cursor / mcp-inspector wiring snippets) |
See docs/roadmap.md for what each sub-phase delivers.
Beyond the per-SDK quick-start tours above, the SQLR-38 umbrella tracks longer, opinionated example apps that exercise SQLRite end-to-end in real-world shapes:
| App | Language / SDK | What it shows | Directory |
|---|---|---|---|
| LLM agent with persistent memory | Python | Vector + lexical recall, fact extraction, summaries — all in one .sqlrite file |
python-agent/ |
| Chat with your notes (MCP) | Node.js | Markdown → SQLRite hybrid retrieval, served to Claude Desktop via sqlrite-mcp --read-only |
nodejs-notes/ |
| Local-first journaling | Tauri 2 + Svelte 5 | Markdown daily notes in one .sqlrite file, BM25 full-text search, "ask my journal" natural-language SQL |
desktop-journal/ |
| Browser SQL playground | WASM | The full engine in WebAssembly — SQL editor, sample datasets, HNSW vector search, all in a browser tab. Live at sqlritedb.com/playground | wasm-playground/ |
| Edge / IoT event collector | Go | HTTP collector + background uploader writing one .sqlrite buffer concurrently via BEGIN CONCURRENT; durable-buffer-for-unreliable-networks shape, with measured throughput |
go-collector/ |
cargo run --example quickstartWalks through opening an in-memory Connection, creating a table, inserting rows, preparing a SELECT, iterating typed Row values, and running a BEGIN / ROLLBACK block. About 50 lines with comments — read rust/quickstart.rs first.
cargo run --example hybrid-retrievalCombines BM25 lexical scoring (Phase 8b) with vector cosine distance (Phase 7d) in a single ORDER BY, showing where each ranking shape wins on the same corpus. Pre-baked vectors keep the example self-contained — no embedding-model dependency. Read hybrid-retrieval/README.md for the narrative.
cargo run --example concurrent_writersEnd-to-end BEGIN CONCURRENT demo with two sibling Connection handles minted via Connection::connect. Two scenarios: disjoint-row commits both succeed; interleaved same-row commits resolve with one winner and one SQLRiteError::Busy → retry. Reads from rust/concurrent_writers.rs; the canonical conceptual walkthrough lives at docs/concurrent-writes.md.
cd examples/c && make runBuilds the Rust cdylib (libsqlrite_c.{so,dylib,dll}) and compiles c/hello.c against its generated header. The binary embeds an rpath pointing at the cargo target dir so ./hello runs without any LD_LIBRARY_PATH / DYLD_* dance. Covers open → execute → query → step → column accessors + an explicit transaction block.
See the top of c/hello.c for the ownership rules that apply to every non-Rust binding (opaque handles, sqlrite_free_string for text columns, thread-local sqlrite_last_error).
# One-time: install maturin and build the wheel into your Python env.
pip install maturin
cd sdk/python && maturin develop
# Then from the repo root:
python examples/python/hello.pyMirrors the Rust quickstart shape via the DB-API: sqlrite.connect(":memory:") → cursor.execute → iterate tuples, plus a BEGIN/ROLLBACK block. See python/hello.py and sdk/python/README.md for the full API tour.
cd examples/python-agent
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
python -m sqlrite_agent # works offline; no API key requiredA full CLI chat agent whose long-term memory is one .sqlrite file. Embeds each turn, hybrid-searches over past messages and a structured facts table on every recall, and survives process restarts. Read python-agent/README.md for the demo script and architecture diagram.
cd examples/nodejs-notes
npm install
node bin/sqlrite-notes.mjs init ~/Documents/notesIngests a folder of markdown notes into a notes.sqlrite file with HNSW + BM25 indexes, then sqlrite-notes serve wraps sqlrite-mcp --read-only so Claude Desktop / any MCP client can bm25_search / vector_search / query / ask your local notes directly — no cloud sync, no third-party indexer. Default embedder is fully offline (deterministic hash bag-of-words); flip to --embedder openai with OPENAI_API_KEY set for real semantic recall. Read nodejs-notes/README.md for the Claude Desktop config snippet and the hybrid-retrieval SQL walkthrough.
# One-time: build the .node binding.
cd sdk/nodejs
npm install
npm run build
# Then from the repo root:
node examples/nodejs/hello.mjsMirrors the better-sqlite3 shape: new Database(":memory:") → db.prepare(sql).all() returning row objects, plus a BEGIN/ROLLBACK block with the inTransaction getter. See nodejs/hello.mjs and sdk/nodejs/README.md for the full API tour.
# One-time: build the C shared library (the Go driver is cgo-linked).
cargo build --release -p sqlrite-ffi
# Then:
cd examples/go
go run hello.goUses the standard library's database/sql API — sql.Open("sqlrite", ":memory:") → db.Query + rows.Scan(&id, &name) into typed Go vars, plus a db.Begin() / tx.Rollback() block. See go/hello.go and sdk/go/README.md for the full API tour.
cd examples/wasm
make # builds sdk/wasm via wasm-pack, then starts a local serverOpens http://localhost:8080 with a tiny SQL console embedded in a single HTML page — CREATE TABLE / INSERT / SELECT all run client-side via the compiled WebAssembly module. No server backend.
The demo pre-fills the textarea with a users table + three inserts + a SELECT ... ORDER BY age DESC. Hit Run and you'll see the JSON result appear in the output pane. Reset DB drops the handle and spins up a fresh in-memory DB.
See wasm/index.html and sdk/wasm/README.md for the full API tour and build options (--target web / bundler / nodejs).
- One shape across languages. Every SDK exposes
Connection,prepare,execute, and typedRowaccess. The language-specific file in each subdir shows the same CRUD + transaction walkthrough, so users picking up a new binding recognize the surface immediately. - No build step required for end users. Phase 6 ships prebuilt wheels (Python),
.nodebinaries (Node.js),libsqlrite.{so,dylib,dll}(for Go / C), and@joaoh82/sqlrite-wasm(browser) — no "install Rust first" tax. - Examples track the engine. Each sub-phase's commit lands the example alongside the binding itself, so the sample always works against the current library shape.