Turso brings SQLite to the edge with global replication, enabling low-latency database access from anywhere in the world.
Why Turso?
- Global replication: Data close to users
- Embedded replicas: SQLite in your app
- SQLite compatibility: Use existing tools
- Low latency: Single-digit milliseconds
Getting Started
# Install CLI
curl -sSfL https://get.tur.so/install.sh | bash
# Create database
turso db create my-app
# Get connection URL
turso db show my-app --url
Using with Drizzle
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
const client = createClient({
url: process.env.TURSO_URL,
authToken: process.env.TURSO_AUTH_TOKEN,
});
const db = drizzle(client);
// Query like normal SQLite
const users = await db.select().from(usersTable);
Embedded Replicas
const client = createClient({
url: "file:local.db",
syncUrl: process.env.TURSO_URL,
authToken: process.env.TURSO_AUTH_TOKEN,
});
// Sync from primary
await client.sync();
Comments (0)
Leave a Comment
No comments yet. Be the first to share your thoughts!