Agent skill

Sqlite Turso

by ericrisco in ericrisco/rsc-harness

A skill your agent uses when deciding whether plain SQLite is enough, or wiring SQLite, Turso or libSQL for local-first, edge and embedded-replica apps — a local file DB, a remote Turso URL, or a…

MITAuto-check passedDatabases

Install Sqlite Turso

skills CLI
$ npx skills add ericrisco/rsc-harness --skill sqlite-turso -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ericrisco/rsc-harness sqlite-turso --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/sqlite-turso .claude/skills/sqlite-turso && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sqlite-turso
GitHub stars
156
Token cost
~2.9k tokens
SKILL.md length
1,149 words
Files
5 (incl. scripts, references)
Skills in repo
229
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when deciding whether plain SQLite is enough, or wiring SQLite, Turso or libSQL for local-first, edge and embedded-replica apps — a local file DB, a remote Turso URL, or a…

  • Deciding whether plain SQLite is enough
  • SKILL.md covers Is SQLite/Turso the right tool?, Three deployment shapes, Connect with @libsql/client and WAL and the pragmas you must set, plus 6 more sections
  • Runs Shell scripts from its folder; calls bash; needs TURSO_AUTH_TOKEN
  • LibSQL for local-first

What it does

Sqlite Turso is an agent skill from ericrisco/rsc-harness. Use when deciding whether plain SQLite is enough, or wiring SQLite, Turso or libSQL for local-first, edge and embedded-replica apps — a local file DB, a remote Turso URL, or a local replica synced to a remote primary — plus WAL mode and SQLite's single-writer model and its lock errors. NOT Drizzle schema or queries on libSQL (that is drizzle-orm), NOT versioned up/down migrations (that is db-migrations), NOT serverless Postgres with branching (that is neon).

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/embedded-replicas.md`).

It sits in Databases, covering Serverless, Database migrations and ORMs and data access. It works with Turso, SQLite, PostgreSQL and Drizzle ORM. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Deciding whether plain SQLite is enough
  • LibSQL for local-first
  • Edge and embedded-replica apps — a local file DB
  • A remote Turso URL

Example prompts

  • “/sqlite-turso”

Requirements

  • A Bash shell
  • A credential in TURSO_AUTH_TOKEN

What it can do on your machine

Read from SKILL.md and the folder at commit 92fde8f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • TURSO_AUTH_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sqlite Turso loads about 2.9k tokens when it runs, and up to ~4.3k if it reads all its reference files. Until then it costs about 120 tokens; SKILL.md has 1,149 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~120
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ericrisco/rsc-harness at commit 92fde8f, republished under its MIT licence (© ericrisco). 1,149 words, ~2,908 tokens.

Download SKILL.mdSave it as .claude/skills/sqlite-turso/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
sqlite-turso
description
Use when deciding whether plain SQLite is enough, or wiring SQLite, Turso or libSQL for local-first, edge and embedded-replica apps — a local file DB, a remote Turso URL, or a local replica synced to a remote primary — plus WAL mode and SQLite's single-writer model and its lock errors. NOT Drizzle schema or queries on libSQL (that is `drizzle-orm`), NOT versioned up/down migrations (that is `db-migrations`), NOT serverless Postgres with branching (that is `neon`).
tags
sqlite, turso, libsql, edge, embedded-replica, local-first, wal
recommends
drizzle-orm, db-migrations, postgresdb, neon, backups, sql
origin
risco

SQLite & Turso/libSQL — decide, connect, operate

SQLite is an in-process, single-file, single-writer relational engine. Turso/libSQL is the fork that adds a remote edge database and — the part people actually want — embedded replicas: a local SQLite file that syncs to a remote primary, so reads are microsecond-local and writes still land durably in the cloud.

This skill is decide + connect + operate. It owns the engine truths (WAL, single writer, pragmas), the three deployment shapes, and wiring the current @libsql/client. It does NOT own schema modeling or type-safe queries (that is drizzle-orm), versioned migration files (that is db-migrations), or backup strategy as a primary task (that is backups).

Is SQLite/Turso the right tool?

Decide first. Picking SQLite for a high-write multi-writer workload is the mistake that wastes a week.

WorkloadVerdictWhy / route
Read-heavy, single-tenant, low-to-moderate writesSQLite/TursoOne writer is plenty; reads are local and fast.
Local-first / offline / edge app needing cloud durabilityTurso embedded replicaLocal file for reads, syncs to a remote primary.
Database-per-user / per-tenant at scaleTursoUnlimited databases on the free tier; cheap isolation.
Many concurrent writers, complex roles, extensionsNo → postgresdb (or mysql)SQLite serializes writers; one writer at a time.
Serverless Postgres with branchingNo → neonTurso is serverless SQLite, not Postgres.
MySQL-compatible serverlessNo → planetscaleDifferent engine and protocol.
Auth + realtime + storage + Postgres bundledNo → supabaseYou want a BaaS, not a raw SQL engine.
Columnar OLAP / analytical aggregatesNo → duckdbSQLite/Turso is OLTP, row-oriented.
Ephemeral cache / KVNo → redisNot a durable relational store.

Three deployment shapes

Every Turso/libSQL decision reduces to which of these three you are wiring. The URL scheme picks the transport automatically.

ShapecreateClient configLatencyWhen
Local fileurl: "file:local.db"In-processDev, CLI tools, single-node app, tests.
Remote edge DBurl: "libsql://<db>.turso.io" + authTokenNetwork round-tripServerless/stateless functions; no local disk to sync.
Embedded replicaurl: "file:local.db" + syncUrl + authTokenMicrosecond readsLocal-first/edge with cloud durability — the flagship.

libsql:// resolves to HTTPS/WSS. file: is native. https:/http: is Hrana HTTP, wss:/ws: is Hrana WebSocket. You rarely set the scheme by hand — you set the URL and the client chooses.

Connect with @libsql/client

Current client is @libsql/client v0.17.x. Never hardcode the auth token — read it from the environment. Convention: TURSO_DATABASE_URL and TURSO_AUTH_TOKEN.

ts
// 1. Local file — dev, tests, single node
import { createClient } from "@libsql/client";

const db = createClient({ url: "file:local.db" });
ts
// 2. Remote edge DB — serverless, no local disk
import { createClient } from "@libsql/client";

const db = createClient({
  url: process.env.TURSO_DATABASE_URL!,   // libsql://<db>.turso.io
  authToken: process.env.TURSO_AUTH_TOKEN!,
});
ts
// 3. Embedded replica — local reads, syncs to the primary
import { createClient } from "@libsql/client";

const db = createClient({
  url: "file:local.db",                   // MUST be a local file
  syncUrl: process.env.TURSO_DATABASE_URL!,
  authToken: process.env.TURSO_AUTH_TOKEN!,
  syncInterval: 60,                        // seconds; or call db.sync() manually
});

Rule: an embedded replica's url is always a local file: — syncUrl is the remote. If you set syncUrl next to a libsql:// url you have not built a replica, you have a confused remote client. (verify.sh enforces exactly this.)

In serverless/edge runtimes the import is the same; just confirm the runtime exposes a writable temp path for the file: replica, or fall back to shape #2 (remote-only).

WAL and the pragmas you must set

For any local file or embedded replica connection, set these per-connection on open. They do not apply to a remote-only client (the primary already runs WAL server-side).

sql
PRAGMA journal_mode = WAL;     -- concurrent readers + one writer; default rollback-journal blocks readers during writes
PRAGMA busy_timeout = 5000;    -- wait up to 5s for the write lock instead of erroring SQLITE_BUSY immediately
PRAGMA foreign_keys = ON;      -- FK enforcement is OFF by default and is PER-CONNECTION — set it every time
PRAGMA synchronous = NORMAL;   -- safe with WAL; far fewer fsyncs than the default FULL

journal_mode is persistent once set on the file; busy_timeout, foreign_keys, and synchronous are per-connection — re-issue them on every new connection (and in pooled environments, on checkout).

Writes, batches, transactions

Always parameterize. String-concatenated SQL is an injection hole and defeats statement caching.

ts
// Bad — string interpolation
await db.execute(`INSERT INTO users (email) VALUES ('${email}')`);

// Good — positional ? args (named $name and tuple [sql, args] forms also work)
await db.execute({ sql: "INSERT INTO users (email) VALUES (?)", args: [email] });

batch runs many statements atomically in one transaction — all commit or all roll back.

ts
// mode: "write" (default), "read", or "deferred"
const rs = await db.batch(
  [
    { sql: "INSERT INTO orders (user_id, total) VALUES (?, ?)", args: [userId, total] },
    { sql: "UPDATE users SET order_count = order_count + 1 WHERE id = ?", args: [userId] },
  ],
  "write",
);

Single-writer rule: SQLite allows exactly one writer at a time. Under concurrent writes you get SQLITE_BUSY / "database is locked". The fix is WAL + busy_timeout above, plus keeping write transactions short. If you genuinely need many simultaneous writers, that is the signal to route to postgresdb — do not paper over it with retries forever.

Embedded replica sync

A replica keeps a local copy of the data and pulls changes from the primary. Reads hit the local file; writes are sent to the primary and propagate back on the next sync.

  • Periodic: pass syncInterval (seconds) to createClient and the client syncs in the background.
  • On-demand: call await db.sync() yourself — it returns { frame_no, frames_synced } (the replication frame you are now at, and how many frames this call pulled).
  • readYourWrites (default true) guarantees a connection sees its own writes immediately. Set it to false only when you specifically want a sync's effect to become observable on its own timeline.
  • Gotcha: calling db.sync() on a remote-only or pure HTTP/WS client throws LibsqlError with code SYNC_NOT_SUPPORTED. Only embedded-replica clients (those with a local file: + syncUrl) can sync.

Deeper material — sync internals, frame numbers, readYourWrites semantics, offline/bidirectional writes, per-tenant database-per-user patterns, stale-read handling — lives in references/embedded-replicas.md.

Show full SKILL.md (425 more words)Show less

libSQL today vs Turso Database (Rust) tomorrow

Two things wear the "Turso" name; do not confuse them.

  • libSQL is the SQLite fork and the battle-tested foundation. For production today, use libSQL via @libsql/client. This is the official guidance — mission-critical workloads run here.
  • Turso Database is a from-scratch rewrite of SQLite in Rust (formerly "Limbo"), adding MVCC concurrent writes and bidirectional offline sync. It is the future direction and where new features land, but it is not the default production target yet.

Separately: "edge replicas" are being discontinued for new users (data showed ~70% never used them), along with multi-DB schemas and ATTACH. Existing paid customers keep them. This is not the same as embedded replicas — embedded replicas remain the flagship. Do not design a new account around edge replicas.

Turso/libSQL also has native vector search (DiskANN). For a dedicated vector store, route to vector-db regardless.

Operate — the turso CLI

bash
turso db create my-app                          # create a database
turso db show my-app --url                       # get the libsql:// URL for TURSO_DATABASE_URL
turso db tokens create my-app                    # mint an auth token for TURSO_AUTH_TOKEN
turso db shell my-app                            # interactive SQL shell against the primary

Pricing note: the free tier offers unlimited databases (post "Database Freedom Day", mid-2025), usage-based with generous read/storage allowances — exact GB and row-read numbers shift, so verify on turso.tech/pricing before quoting a figure. This is what makes database-per-user economical.

Route out: backups/restore strategy → backups; versioned migrations → db-migrations; type-safe schema and queries → drizzle-orm; generic SQL authoring (window functions, tuning) → sql.

Anti-patterns

Anti-patternWhy it bitesDo instead
Treating SQLite like multi-writer PostgresOne writer at a time → SQLITE_BUSY storms under loadKeep writes serial + short, or route to postgresdb
Forgetting PRAGMA journal_mode=WALDefault journal blocks readers during every writeSet WAL on local file / replica connections
Embedded replica with a libsql:// urlNot a replica — a confused remote client; reads aren't localurl: is a local file:, remote goes in syncUrl
Hardcoding the auth token in sourceLeaks a credential into VCSRead process.env.TURSO_AUTH_TOKEN
Calling db.sync() on a remote/HTTP clientThrows LibsqlError SYNC_NOT_SUPPORTEDOnly sync embedded-replica clients
Assuming FK constraints are enforcedforeign_keys is OFF by default, per-connectionPRAGMA foreign_keys=ON on every connection
Designing a new account around edge replicasDiscontinued for new usersUse embedded replicas (the flagship)
String-concatenated SQLInjection + no statement cachingParameterize with ? / $name / tuple args
Reaching for Turso for OLAP dashboardsRow-store, single writer — wrong shapeUse duckdb for columnar analytics
Layering migrations/ORM logic into this skillOut of scope; duplicates sibling rigordb-migrations / drizzle-orm

Verify

When you emit a connection/config file, gate it:

bash
bash scripts/verify.sh path/to/db.ts        # or a directory; defaults to cwd

It statically checks (no network): @libsql/client import + createClient use; that a syncUrl always sits next to a local file: url; no hardcoded token literal; and (advisory) WAL pragma presence on file-backed clients. Read-only; exits 0 on a clean/empty target.

© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in skills/sqlite-turso of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/embedded-replicas.md
  • scripts/verify.sh

Open the folder on GitHubat commit 92fde8f

Compare with similar skills

Sqlite Turso next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sqlite Turso compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sqlite Turso this skillericrisco/rsc-harness156—~2.9kAutomated safety check: PassMIT
Better Drizzlealmeidazs/better-drizzle347—~1.7kAutomated safety check: PassApache-2.0
Uql Ormrogerpadilla/uql125—~3.5kAutomated safety check: PassMIT
Prisma 8 Contract-First ORMprisma/orm48k—~3.7kAutomated safety check: NotesApache-2.0
Daoyou Data LayerChurchTao/Daoyou119—~1.9kAutomated safety check: PassGPL-3.0
Drizzle Orm Expertdavila7/claude-code-templates32k3 repos~2.6kAutomated safety check: PassMIT

Similar skills

  • Better Drizzle

    almeidazs/better-drizzle

    Write, review, and debug code that uses better-drizzle, the typed repository layer over Drizzle ORM 1.x (better(db), client.users.findMany, paginate, cursor, upsertMany, relation include/connect…

    347 GitHub stars~1.7k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Uql Orm

    rogerpadilla/uql

    Write code with UQL (the uql-orm package), the TypeScript ORM whose queries are plain JSON objects, on PostgreSQL, MySQL, MariaDB, SQLite, CockroachDB, SQL Server, MongoDB, Turso, Neon, D1 and PGlite.

    125 GitHub stars~3.5k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Official

    Routes Prisma 8 tasks such as contracts, migrations, queries and upgrades to the right reference files for projects on the contract-first @prisma/orm packages.

    48k GitHub stars~3.7k tokensUpdated yesterday
    DatabasesAuto-check: notes
  • Daoyou Data Layer

    ChurchTao/Daoyou

    Daoyou Drizzle/PostgreSQL、事务、V6 角色与宗门归属、统一背包、Redis 战局和回放归档指南。Use when modifying schema, migrations, repositories, persistence mappers, resource commits or durable game models.

    119 GitHub stars~1.9k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Drizzle Orm Expert

    davila7/claude-code-templates

    Expert in Drizzle ORM for TypeScript — schema design, relational queries, migrations, and serverless database integration.

    32k GitHub starsUsed in 3 repos~2.6k tokens
    DatabasesAuto-check passed
  • Drizzle Orm

    EpicenterHQ/epicenter

    Apply Drizzle ORM patterns for schemas, migrations, queries, branded types, and Postgres or D1 boundaries.

    4.8k GitHub stars~1.3k tokensUpdated today
    DatabasesAuto-check passed

More from ericrisco/rsc-harness

All 229 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    156 GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    156 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    156 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    156 GitHub stars~3.2k tokensUpdated yesterday
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    156 GitHub stars~3.3k tokensUpdated yesterday
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    156 GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Sqlite Turso

What does Sqlite Turso do?

A skill your agent uses when deciding whether plain SQLite is enough, or wiring SQLite, Turso or libSQL for local-first, edge and embedded-replica apps — a local file DB, a remote Turso URL, or a…. Sqlite Turso is an agent skill from ericrisco/rsc-harness. Use when deciding whether plain SQLite is enough, or wiring SQLite, Turso or libSQL for local-first, edge and embedded-replica apps — a local file DB, a remote Turso URL, or a local replica synced to a remote primary — plus WAL mode and SQLite's single-writer model and its lock errors.

When should I use Sqlite Turso?

Sqlite Turso fits situations like: deciding whether plain SQLite is enough; libSQL for local-first; edge and embedded-replica apps — a local file DB; A remote Turso URL.

How do I install Sqlite Turso in Claude Code?

Run `npx skills add ericrisco/rsc-harness --skill sqlite-turso -a claude-code`. Or copy the skill folder (skills/sqlite-turso in ericrisco/rsc-harness) into .claude/skills/sqlite-turso in your project. Claude Code loads it when a task matches its description.

How do I install Sqlite Turso in Codex?

Run `npx skills add ericrisco/rsc-harness --skill sqlite-turso -a codex`. Or copy the skill folder (skills/sqlite-turso in ericrisco/rsc-harness) into .agents/skills/sqlite-turso in your project. Codex loads it when a task matches its description.

Can I use Sqlite Turso in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill sqlite-turso -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sqlite-turso, .gemini/skills/sqlite-turso, .github/skills/sqlite-turso and .opencode/skills/sqlite-turso in your project.

What does Sqlite Turso need to run?

Going by SKILL.md and its folder, Sqlite Turso needs a shell for the scripts in its folder, the command-line tools its instructions call (bash) and credentials named TURSO_AUTH_TOKEN. Our summary lists: A Bash shell; A credential in TURSO_AUTH_TOKEN.

Does Sqlite Turso access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Sqlite Turso safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Sqlite Turso use?

Sqlite Turso is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sqlite Turso use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.4k tokens, read only when the agent opens those files.

What are the alternatives to Sqlite Turso?

Skills that share tags, products or a category with Sqlite Turso: Better Drizzle (almeidazs/better-drizzle, 347 stars), Uql Orm (rogerpadilla/uql, 125 stars), Prisma 8 Contract-First ORM (prisma/orm, 48k stars) and Daoyou Data Layer (ChurchTao/Daoyou, 119 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sqlite Turso?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 156 GitHub stars. The repository holds 229 skills in this directory. The repository was last updated on October 6, 2026.

Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.