The sqld
("SQL daemon") project is a server mode for libSQL.
Embedded SQL databases such as libSQL and SQLite are great for a lot of use cases, but sometimes you really do want to consume your database as a server.
For example, with serverless apps, fitting a database engine, as slim as it may be, might be hard, and even when it's possible, it might be really inconvenient, which is why we created sqld
.
With sqld
you can use SQLite-like interface in your app, but have a transparent proxy translates the C API calls to PostgreSQL wire protocol to talk to a database server, which is internally libSQL.
Disclaimer: although you can connect to sqld
with a PostgreSQL client and many things just work because PostgreSQL and SQLite are so similar, the goal of this project is to provide SQLite compatibility at the client.
That is, whenever there's a conflict in behaviour between SQLite and PostgreSQL, we always go with SQLite behavior.
However, if libSQL starts to provide more PostgreSQL compatibility, sqld
will also support that.
- SQLite dialect layered on top of HTTP or the PostgreSQL wire protocol.
- TypeScript/JavaScript client
- SQLite-compatible API that you can drop-in with
LD_PRELOAD
in your application to switch from local database to a remote database. - Read replica support.
- Integration with mvSQLite for high availability and fault tolerance.
- Client authentication and TLS
- Integration with libSQL's bottomless storage
Start a server with:
cargo run
and connect to it with psql:
psql -h 127.0.0.1 -p 5432
Linux:
./scripts/install-deps.sh
git submodule update --init --force --recursive --depth 1
cargo build
make test
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in sqld
by you, shall be licensed as MIT, without any additional terms or conditions.