Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsApr 12, 2026·3 min de lectura

libSQL (Turso) — Open-Contribution Fork of SQLite

libSQL is a fork of SQLite that is both open source and open to contributions. Created by Turso to add features SQLite cannot: embedded replicas, server mode, vector search, and ALTER TABLE extensions. The edge database for modern apps.

Listo para agents

Instalación con revisión previa

Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.

Needs Confirmation · 64/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
step-1.md
Comando con revisión previa
npx -y tokrepo@latest install 290afe5f-3641-11f1-9bc6-00163e2b0d79 --target codex

Primero dry-run, confirma las escrituras y luego ejecuta este comando.

TL;DR
libSQL extends SQLite with embedded replicas, server mode, vector search, and open-source contributions.
§01

What it is

libSQL is a fork of SQLite created by Turso that is both open source and open to contributions. SQLite itself does not accept external contributions. libSQL adds features that SQLite cannot: embedded replicas, a standalone server mode, vector search columns, and ALTER TABLE extensions.

libSQL targets developers building modern applications who want SQLite simplicity with features needed for edge computing, distributed reads, and AI workloads like vector similarity search.

§02

How it saves time or tokens

libSQL embedded replicas let your application read from a local SQLite file that automatically syncs from a remote primary. This eliminates the latency of network database queries for read-heavy workloads. The Turso CLI provides instant database creation and management without infrastructure setup.

§03

How to use

  1. Install the Turso CLI and create a database:
brew install tursodatabase/tap/turso
turso db create mydb
turso db shell mydb
  1. Or run libSQL locally with Docker:
docker run -d --name libsql -p 8080:8080 ghcr.io/tursodatabase/libsql-server:latest
  1. Connect from your application using a libSQL client library.
§04

Example

-- libSQL extends SQLite with vector columns
CREATE TABLE documents (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  title TEXT NOT NULL,
  embedding F32_BLOB(384)
);

-- Insert with vector data
INSERT INTO documents (title, embedding)
VALUES ('AI Guide', vector('[0.1, 0.2, ...]'));

-- Vector similarity search
SELECT title, vector_distance_cos(embedding, vector('[0.1, 0.2, ...]')) AS distance
FROM documents
ORDER BY distance
LIMIT 5;
§05

Related on TokRepo

§06

Common pitfalls

  • libSQL is wire-compatible with SQLite but adds extensions. Code written for libSQL vector features will not work on stock SQLite.
  • Embedded replicas are read-only. Write operations must go through the primary server.
  • The Turso managed service has a free tier with limits. Self-hosting libSQL-server removes those limits but requires your own infrastructure.

Preguntas frecuentes

How does libSQL differ from SQLite?+

libSQL is a fork that accepts community contributions and adds features: embedded replicas for edge sync, a standalone HTTP server mode, vector search columns (F32_BLOB), and enhanced ALTER TABLE support. It remains compatible with the SQLite file format.

What is an embedded replica?+

An embedded replica is a local SQLite file that automatically syncs from a remote libSQL primary. Your app reads from the local file (zero network latency) while writes go to the primary and replicate back.

Does libSQL support vector search?+

Yes. libSQL adds a F32_BLOB column type for storing float32 vectors and provides vector_distance_cos and vector_distance_l2 functions for similarity search directly in SQL queries.

What is the relationship between libSQL and Turso?+

Turso created libSQL as the open-source database engine and offers Turso Cloud as a managed service built on libSQL. You can use libSQL self-hosted or through Turso Cloud.

Can existing SQLite databases work with libSQL?+

Yes. libSQL reads and writes standard SQLite database files. You can open an existing SQLite database with libSQL and use it as-is. The new features are opt-in.

Referencias (3)

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados