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 是 SQLite 的开源分支,接受公开的贡献:它同样是可以嵌入到程序里的 SQL 数据库,并在此基础上扩展了嵌入式副本、远程访问等功能,同时保持与 SQLite 兼容。
它是一个库、一个服务器,还是命令行工具?它本质上是一个嵌入到你自己进程里的 C 库,可以通过 libSQL API 或原生的 SQLite C API 来使用;这个项目还提供了用于远程访问的 libSQL 服务器,以及名为 libsql 的命令行 SQL 界面。
我在本地怎么把它跑起来?从仓库构建与 SQLite 兼容的 C 库和工具,然后运行 libsql 程序进入交互式 SQL 命令行——或者用 Docker 一键启动所有东西。在自己写代码时,添加一个官方的语言驱动就行,不需要自己编译任何东西。
我可以用哪些语言来使用它?官方驱动支持 TypeScript/JavaScript、Rust 和 Go(包括无需 CGO 的构建方式)。Python 和 C 驱动还处于实验阶段,社区维护了 PHP、D 和 Ring 驱动。
和完整的客户端-服务器数据库相比,它有什么局限?它保留了 SQLite 的基本特性,包括单写入者模型,所以不支持并发写入。另外,新功能的开发现在都放在 Turso 上——libSQL 仍在维护,但新功能不再在这里发布。
嵌入式数据库不用联网也能工作吗?嵌入式使用是可以的——libSQL 直接运行在你的进程里,不需要网络连接,而且嵌入式副本功能可以让你在应用内部保留一个复制的数据库。
我经常听说 Turso——就是这个项目吗?不是。Turso 是同一个团队的另一个独立项目:一个用 Rust 从零重写的、与 SQLite 兼容的数据库,目前处于 beta 阶段,支持并发写入和离线同步。libSQL 是这个分支——仍在积极维护,但新功能都在 Turso 上开发,所以新项目不妨先看看 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