libsql README

The project's README from github.com/tursodatabase/libsql. As one markdown file: README.md.

libSQL by Turso

libSQL

libSQL is an open source, open contribution fork of SQLite, created and maintained by Turso.

libSQL Docs · libSQL Manifesto · Turso · Turso Docs · Discord · Blog & Tutorials

MIT discord activity phorm.ai


[!IMPORTANT] Turso database and libSQL are two different projects from the same team.

libSQL (this repository) is an open-source fork of SQLite. It extends SQLite with features like embedded replicas and remote access, but inherits SQLite's fundamental limitations such as the single-writer model.

Turso database is a SQLite-compatible database rewritten from scratch in Rust. It is not a fork of SQLite — it is a completely new implementation that goes beyond what any SQLite fork can offer, including concurrent writes and bi-directional sync with offline support. Turso is currently in beta.

If you're starting a new project, you probably want to look into Turso. libSQL is actively maintained, but new features are being developed in Turso.

Documentation

We aim to evolve it to suit many more use cases than SQLite was originally designed for, and plan to use third-party OSS code wherever it makes sense.

libSQL has many great features, including:

There are also various improvements and extensions to the core SQLite:

The comprehensive description can be found here

Official Drivers

Experimental Drivers

Community Drivers

GUI Support

Getting Started

The project provides two interfaces: the libSQL API, which supports all the features, and the SQLite C API for compatibility.

To build the SQLite-compatible C library and tools, run:

cargo xtask build

To run the SQL shell, launch the libsql program:

$ cd libsql-sqlite3 && ./libsql
libSQL version 0.2.1 (based on SQLite version 3.43.0) 2023-05-23 11:47:56
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
libsql>

Docker

To run libSQL using docker, refer to the Docker Docs

Why a fork?

SQLite has solidified its place in modern technology stacks, embedded in nearly any computing device you can think of. Its open source nature and public domain availability make it a popular choice for modification to meet specific use cases.

But despite having its code available, SQLite famously doesn't accept external contributors and doesn't adhere to a code of conduct. So community improvements cannot be widely enjoyed.

There have been other forks in the past, but they all focus on a specific technical difference. We aim to be a community where people can contribute from many different angles and motivations.

We want to see a world where everyone can benefit from all the great ideas and hard work that the SQLite community contributes back to the codebase. Community contributions work well, because we’ve done it before. If this was possible, what do you think SQLite could become?

You can read more about our goals and motivation in our product vision.

Compatibility with SQLite

Compatibility with SQLite is of great importance for us. But it can mean many things. So here's our stance:

License

libSQL is licensed under an Open Source License, and we adhere to a clear Code of Conduct.

libsql (tursodatabase/libsql)

Searching Database…

17.3K ·GitHub
Что это такое?libSQL — это open-source форк SQLite с открытым приёмом изменений от сообщества: та же встраиваемая SQL-база данных, но расширенная возможностями вроде embedded replicas (встроенных реплик) и удалённого доступа, при этом полностью совместимая с SQLite.
Это библиотека, сервер или утилита командной строки?По своей сути это C-библиотека, которую вы встраиваете в свой процесс; доступ к ней можно получить через API libSQL или обычный C API SQLite. Кроме того, в проекте есть сервер libSQL для удалённого доступа и SQL-шелл командной строки libsql.
Как запустить его у себя локально?Соберите C-библиотеку и утилиты, совместимые с SQLite, из репозитория, затем запустите программу libsql — получится интерактивный SQL-шелл. Либо поднимите всё через Docker. В своём коде просто подключите официальный драйвер для нужного языка — компилировать ничего не придётся.
С какими языками его можно использовать?Официальные драйверы есть для TypeScript/JavaScript, Rust и Go (в том числе сборка без CGO). Драйверы для Python и C пока экспериментальные, а сообщество поддерживает драйверы для PHP, D и Ring.
В чём подвох по сравнению с полноценной клиент-серверной базой данных?Проект сохраняет базовые принципы SQLite, в том числе модель с одним писателем, так что одновременных записей не будет. К тому же новая функциональность теперь развивается в Turso — libSQL по-прежнему поддерживается, но новые фичи там больше не появляются.
Работает ли встроенная база без сети?Для встроенного использования — да: libSQL работает внутри вашего процесса и не требует сетевого подключения, а embedded replicas позволяют держать реплицированную базу прямо внутри приложения.
Я постоянно слышу про Turso — это тот же проект?Нет. Turso — отдельный проект той же команды: база данных, совместимая с SQLite, написанная с нуля на Rust, сейчас в бета-версии, с одновременными записями и офлайн-синхронизацией. libSQL — это вот этот форк: активно поддерживается, но новые фичи разрабатываются в Turso, так что для новых проектов стоит сначала посмотреть туда.
Есть ли графический интерфейс, который можно использовать с ним?Да. Beekeeper Studio и TablePlus работают на macOS, Windows и Linux; Outerbase и libSQL Studio запускаются в браузере; Dataflare платный, но есть ограниченная бесплатная версия.
Какие низкоуровневые улучшения он добавляет в ядро SQLite?Расширение ALTER TABLE для изменения типов и ограничений столбцов, рандомизированные ROWID, пользовательские функции на WebAssembly, возможность передавать SQL-строки в виртуальные таблицы и интерфейс виртуального журнала упреждающей записи (write-ahead log).
Size
190.6 MB
Stars
17.3K
Age
4y
Commits · 90 Days