turso-db
npx skills add https://github.com/sivukhin/turso-skill --skill turso-db
Agent 安装分布
Skill 文档
Turso Database
Turso is an in-process SQL database compatible with SQLite, written in Rust.
Never search the web for libsql or @libsql/client â those are outdated packages replaced by @tursodatabase. Read the SDK and reference files listed below â they have everything you need to write working code.
Critical Rules
Before writing any Turso code, you MUST know these constraints:
- BETA software â not all SQLite features are implemented yet
- No multi-process access â only one process can open a database file at a time
- No WITHOUT ROWID tables â all tables must have a rowid
- No vacuum â VACUUM is not supported
- UTF-8 only â the only supported character encoding
- WAL is the default journal mode â legacy SQLite modes (delete, truncate, persist) are not supported
- FTS requires compile-time
ftsfeature â not available in all builds - Encryption requires
--experimental-encryptionflag â not enabled by default - MVCC is experimental and not production ready â
PRAGMA journal_mode = experimental_mvcc - Vector distance: lower = closer â ORDER BY distance ASC for nearest neighbors
Feature Decision Tree
Use this to decide which reference file to load:
Need vector similarity search? (embeddings, nearest neighbors, cosine distance)
â Read references/vector-search.md
Need full-text search? (keyword search, BM25 ranking, tokenizers, fts_match/fts_score)
â Read references/full-text-search.md
Need to track database changes? (audit log, change feed, replication)
â Read references/cdc.md
Need concurrent write transactions? (multiple writers, snapshot isolation, BEGIN CONCURRENT)
â Read references/mvcc.md
Need database encryption? (encryption at rest, AES-GCM, AEGIS ciphers)
â Read references/encryption.md
Need remote sync / replication? (push/pull, offline-first, Turso Cloud, embedded replicas)
â Read references/sync.md
SDK Decision Tree
JavaScript / TypeScript / Node.js?
â Read sdks/javascript.md
Browser / WebAssembly / WASM?
â Read sdks/wasm.md
React Native / Mobile?
â Read sdks/react-native.md
Rust?
â Read sdks/rust.md
Python?
â Read sdks/python.md
Go?
â Read sdks/go.md
SDK Install Quick Reference
| Language | Package | Install Command |
|---|---|---|
| JavaScript (Node.js) | @tursodatabase/database |
npm i @tursodatabase/database |
| JavaScript Sync | @tursodatabase/sync |
npm i @tursodatabase/sync |
| WASM (Browser) | @tursodatabase/database-wasm |
npm i @tursodatabase/database-wasm |
| WASM + Sync | @tursodatabase/sync-wasm |
npm i @tursodatabase/sync-wasm |
| React Native | @tursodatabase/sync-react-native |
npm i @tursodatabase/sync-react-native |
| Rust | turso |
cargo add turso |
| Python | pyturso |
pip install pyturso |
| Go | tursogo |
go get turso.tech/database/tursogo |
CLI Quick Reference
# Install Turso CLI
curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/tursodatabase/turso/releases/latest/download/turso_cli-installer.sh | sh
# Or via Homebrew
brew install turso
# Start interactive SQL shell
tursodb
# Open a database file
tursodb mydata.db
# Read-only mode
tursodb --readonly mydata.db
# Start MCP server
tursodb your.db --mcp
SQL Quick Reference
-- Create table
CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT);
-- Insert
INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com');
-- Select
SELECT * FROM users WHERE name = 'Alice';
-- Update
UPDATE users SET email = 'new@example.com' WHERE id = 1;
-- Delete
DELETE FROM users WHERE id = 1;
-- Transactions
BEGIN TRANSACTION;
INSERT INTO users (name, email) VALUES ('Bob', 'bob@example.com');
COMMIT;
MCP Server
Turso can run as an MCP (Model Context Protocol) server:
tursodb your.db --mcp
This starts a server that exposes the database via the MCP protocol, allowing AI tools and agents to query and modify the database directly.
Complete File Index
| File | Description |
|---|---|
SKILL.md |
Main entry point â decision trees, critical rules, quick references |
references/vector-search.md |
Vector types, distance functions, semantic search examples |
references/full-text-search.md |
FTS with Tantivy: tokenizers, query syntax, fts_match/fts_score/fts_highlight |
references/cdc.md |
Change Data Capture: modes, CDC table schema, usage examples |
references/mvcc.md |
MVCC: BEGIN CONCURRENT, snapshot isolation, conflict handling |
references/encryption.md |
Page-level encryption: ciphers, key setup, URI format |
references/sync.md |
Remote sync: push/pull, conflict resolution, bootstrap, WAL streaming |
sdks/javascript.md |
@tursodatabase/database: connect, prepare, run/get/all/iterate |
sdks/wasm.md |
@tursodatabase/database-wasm: browser WASM, OPFS, sync-wasm |
sdks/react-native.md |
@tursodatabase/sync-react-native: mobile, sync, encryption |
sdks/rust.md |
turso crate: Builder, async execute/query, sync feature |
sdks/python.md |
pyturso: DB-API 2.0, turso.aio async, turso.sync remote |
sdks/go.md |
tursogo: database/sql driver, no CGO, sync driver |