turso
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTurso Database
Turso 数据库
SQLite-compatible embedded database for modern applications, AI agents, and edge computing.
适用于现代应用、AI Agent 和边缘计算的 SQLite 兼容嵌入式数据库。
Quick Navigation
快速导航
| Topic | Reference |
|---|---|
| Installation | installation.md |
| Encryption | encryption.md |
| Authorization | auth.md |
| Sync | sync.md |
| Agent DBs | agents.md |
| 主题 | 参考链接 |
|---|---|
| 安装 | installation.md |
| 加密 | encryption.md |
| 授权 | auth.md |
| 同步 | sync.md |
| Agent 数据库 | agents.md |
When to Use
适用场景
- Embedded SQLite database with cloud sync
- AI agent state management and multi-agent coordination
- Offline-first applications
- Encrypted databases (AEGIS, AES-GCM)
- Edge computing and IoT devices
- 带云同步功能的嵌入式SQLite数据库
- AI Agent状态管理与多Agent协同
- 离线优先应用
- 加密数据库(AEGIS、AES-GCM)
- 边缘计算与物联网设备
Core Concepts
核心概念
libSQL
libSQL
Turso is built on libSQL, an open-source fork of SQLite with:
- Native encryption (AEGIS-256, AES-GCM)
- Async I/O (Linux io_uring)
- Cloud sync capabilities
Turso 基于 libSQL 构建,libSQL是SQLite的开源分支,具备以下特性:
- 原生加密(AEGIS-256、AES-GCM)
- 异步I/O(Linux io_uring)
- 云同步能力
Deployment Options
部署选项
- Embedded — runs locally in your app
- Turso Cloud — managed platform with branching, backups
- Hybrid — local with cloud sync (push/pull)
- 嵌入式 — 在应用本地运行
- Turso 云服务 — 支持分支、备份的托管平台
- 混合模式 — 本地运行并同步到云端(推送/拉取)
Common Patterns
常见模式
Encrypted Database
加密数据库
bash
openssl rand -hex 32 # Generate key
tursodb --experimental-encryption "file:db.db?cipher=aegis256&hexkey=YOUR_KEY"bash
openssl rand -hex 32 # Generate key
tursodb --experimental-encryption "file:db.db?cipher=aegis256&hexkey=YOUR_KEY"Cloud Sync
云同步
typescript
import { connect } from "@tursodatabase/sync";
const db = await connect({
path: "./local.db",
url: "libsql://...",
authToken: process.env.TURSO_AUTH_TOKEN,
});
await db.push(); // local → cloud
await db.pull(); // cloud → localtypescript
import { connect } from "@tursodatabase/sync";
const db = await connect({
path: "./local.db",
url: "libsql://...",
authToken: process.env.TURSO_AUTH_TOKEN,
});
await db.push(); // local → cloud
await db.pull(); // cloud → localAgent Database
Agent 数据库
javascript
import { connect } from "@tursodatabase/database";
// Local-first
const db = await connect("agent.db");
// Or with sync
const db = await connect({
path: "agent.db",
url: "https://db.turso.io",
authToken: "...",
sync: "full",
});javascript
import { connect } from "@tursodatabase/database";
// Local-first
const db = await connect("agent.db");
// Or with sync
const db = await connect({
path: "agent.db",
url: "https://db.turso.io",
authToken: "...",
sync: "full",
});Version
版本
Based on product version: 0.4.3
基于产品版本:0.4.3