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.
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.
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.
How to use
- Install the Turso CLI and create a database:
brew install tursodatabase/tap/turso
turso db create mydb
turso db shell mydb
- Or run libSQL locally with Docker:
docker run -d --name libsql -p 8080:8080 ghcr.io/tursodatabase/libsql-server:latest
- Connect from your application using a libSQL client library.
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;
Related on TokRepo
- Database Tools -- Database and data storage solutions
- AI Tools for RAG -- Vector search for retrieval-augmented generation
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.
Frequently Asked Questions
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.
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.
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.
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.
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.
Citations (3)
- libSQL GitHub— libSQL is an open-contribution fork of SQLite by Turso
- Turso Documentation— Turso database platform documentation
- SQLite Documentation— SQLite file format specification
Related on TokRepo
Discussion
Related Assets
Moodle — Open-Source Learning Management System
The most widely used open-source learning platform, providing course management, assessments, and collaboration tools for educators and organizations worldwide.
Sylius — Headless E-Commerce Framework on Symfony
An open-source headless e-commerce platform built on Symfony and API Platform, designed for developers who need a customizable and API-first commerce solution.
Akaunting — Free Self-Hosted Accounting Software
A free, open-source online accounting application built on Laravel for small businesses and freelancers to manage invoices, expenses, and financial reports.