Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Initial release!

Pre-release
Pre-release
Compare
Choose a tag to compare
@glommer glommer released this 20 Jan 19:21
· 878 commits to main since this release

We are excited to announce the first release of sqld, a server mode for libSQL.

In this release, you can access your SQLite-compatible database over the network, using the postgres or http protocols.

Start the server with:

sqld -d foo.db -p 127.0.0.1:5432 --http-listen-addr=127.0.0.1:8000

-d indicates the file name, -p the address for the postgres protocol listener, and --http-listen-addr the address of the http listener.

Now connect with psql:

$ psql -q postgres://127.0.0.1
glaubercosta=> create table databases (name text);
 - 
(0 rows)
glaubercosta=> insert into databases (name) values ('libsql');
 - 
(0 rows)
glaubercosta=> select * from databases;
name
 - - - - 
libsql
(1 row)

and HTTP:

$ curl -s -d "{\"statements\": [\"SELECT * from databases;\"] }" \
  http://127.0.0.1:8000
[[{"name":"libsql"}]]

The sqlite shell can be used to inspect the file directly:

$ sqlite3 foo.db
SQLite version 3.37.0 2021–12–09 01:34:53
Enter ".help" for usage hints.
sqlite> select * from databases;
libsql