llms.txt Content
# Turso
> Turso is an in-process SQL database, compatible with SQLite.
## Overview
Turso is a SQLite-compatible database built for modern applications. It runs embedded in your application and syncs to Turso Cloud.
- GitHub: https://github.com/tursodatabase/turso
- Documentation: https://docs.turso.tech
Turso is currently in beta and supports:
- Concurrent writes
- Encryption at rest
- Vector search (embeddings)
- Full-text search
- Turso Sync (sync to cloud)
## libSQL
libSQL is a production-ready SQLite fork built by the Turso team.
- GitHub: https://github.com/tursodatabase/libsql
libSQL supports:
- Full SQLite compatibility
- HTTP protocol for remote access
- SQLite extensions
- Sync via Embedded Replicas (simpler sync for read-heavy workloads)
Note: Once Turso becomes GA, it will be a drop-in replacement for libSQL with additional features.
You are encouraged to use Turso by default if you can build with a beta release; otherwise libSQL
is the way to use Turso Cloud.
## Turso Sync
Turso Sync is the core feature for syncing local databases to Turso Cloud.
- Sync local SQLite databases to the cloud
- Works offline, automatically syncs when connected
- Conflict resolution for concurrent writes
- Available in TypeScript, React Native, and other SDKs
Note that libSQL also supports a simpler sync, called embedded replicas. However, for robust
sync it is recommended to use Turso.
### TypeScript Example
```typescript
import { TursoDatabase } from "@tursodatabase/database";
import { TursoSync } from "@tursodatabase/sync";
const db = new TursoDatabase(":memory:");
const sync = new TursoSync(db, {
url: process.env.TURSO_DATABASE_URL,
authToken: process.env.TURSO_AUTH_TOKEN,
});
await sync.sync();
```
### React Native Example
```typescript
import { TursoSync } from "@tursodatabase/sync-react-native";
const sync = new TursoSync({
url: process.env.TURSO_DATABASE_URL,
authToken: process.env.TURSO_AUTH_TOKEN,
});
await sync.sync();
```
## Turso