turso

v2026.09.24

Turso edge-hosted SQLite platform built on libSQL (open-source SQLite fork). Covers @libsql/client SDK, embedded replicas with local sync, multi-database per-tenant architecture, platform API for database provisioning, schema migrations, vector search with F32_BLOB, batch operations, interactive transactions, and encryption at rest. Use when connecting to Turso databases, configuring embedded replicas, provisioning databases via the platform API, implementing per-tenant database isolation, performing vector similarity search, or integrating libSQL with Drizzle ORM.

GitHub
Install command
npx skhub add oakoss/turso
Markdown
SKILL.md

Turso

Overview

Turso is an edge-hosted SQLite platform built on libSQL, an open-source fork of SQLite. It provides globally distributed databases with embedded replicas for local-first reads, a platform API for programmatic database management, and native vector search. Use Turso for edge-deployed applications needing low-latency reads, per-tenant database isolation, or offline-capable embedded replicas. Avoid when you need a traditional relational database with complex joins across tenants or require PostgreSQL-specific features.

Quick Reference

PatternAPI / CommandKey Points
Remote clientcreateClient({ url, authToken })Connect to Turso cloud database
Local file clientcreateClient({ url: 'file:local.db' })Pure local SQLite via libSQL
Embedded replicacreateClient({ url, syncUrl, authToken })Local reads, remote sync
Manual syncclient.sync()Pull latest changes from remote
Periodic syncsyncInterval: 60 in client configAuto-sync interval in seconds
Execute queryclient.execute({ sql, args })Positional ? or named $param args
Batch operationsclient.batch([...statements], mode)Atomic multi-statement execution
Interactive transactionclient.transaction('write')Multi-step logic with commit/rollback
Encryption at restencryptionKey in client configEncrypts local database file
Vector insertvector32('[0.1, 0.2, ...]')Store embeddings as F32_BLOB columns
Vector searchvector_distance_cos(col, vector32(...))Cosine similarity, ORDER BY distance ASC
Vector indexlibsql_vector_idx(col, 'type=diskann')DiskANN index for efficient nearest-neighbor
Create database (CLI)turso db create <name>Provision new database
Create database (API)POST /v1/organizations/{org}/databasesProgrammatic provisioning for multi-tenant
Generate token (CLI)turso db tokens create <name>Auth tokens with optional read-only and expiration
Drizzle integrationdrizzle(createClient({ url, authToken }))Use drizzle-orm/libsql driver
In-memory databasecreateClient({ url: ':memory:' })Ephemeral database for testing

Common Mistakes

MistakeCorrect Pattern
Using syncUrl without authTokenEmbedded replicas require both syncUrl and authToken
Forgetting client.sync() before readsCall sync() or set syncInterval to keep replica current
Using vector_distance_cos without a vector indexCreate a libsql_vector_idx index for efficient similarity search
Hardcoding auth tokens in source codeUse environment variables for TURSO_DATABASE_URL and TURSO_AUTH_TOKEN
Using interactive transactions for simple batchesUse client.batch() for atomic multi-statement operations
Not closing transactions on errorAlways call transaction.close() in a finally block
Creating one database for all tenantsUse multi-database per-tenant isolation for SaaS workloads
Passing raw arrays as vector valuesWrap vectors with vector32() SQL function or pass as Float32Array
Using ORDER BY distance DESC for nearest neighborCosine distance: smaller is closer, use ORDER BY distance ASC

Delegation

If the drizzle-orm skill is available, delegate ORM schema definition, query building, relations, and migration patterns to it. Otherwise, recommend: pnpm dlx skills add oakoss/agent-skills -s drizzle-orm -a claude-code -y

If the local-first skill is available, delegate architecture decisions, sync engine comparisons, and conflict resolution strategies to it. Otherwise, recommend: pnpm dlx skills add oakoss/agent-skills -s local-first -a claude-code -y

If the pglite skill is available, delegate PGlite-specific patterns for comparison with Turso embedded replicas.

  • Database provisioning: Use Task agent for multi-tenant setup automation
  • Vector search tuning: Use Explore agent to research embedding models and dimensions
  • Code review: Delegate to code-reviewer agent

References

Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.24

Published

Sep 24, 2026

Category

Uncategorized

License

Not specified

Source path

skills/turso

Default branch

main

Latest commit

85e3a39

Tree SHA

a4c9e7b