Skip to content

Connect to libSQL / SQLite

Tested with: libsql-server (sqld) 0.24 on Databasezy · drivers listed per tab · zb CLI 0.1

libSQL is SQLite served over the network. The instance runs libsql-server (sqld) and speaks the Hrana protocol over HTTPS and WebSockets, so the clients are HTTP clients and there is no CA to download: the certificate is publicly trusted and verified by your language’s TLS stack.

  1. Copy the URL from Connect. libSQL uses a JWT-style auth token instead of a username and password; it is shown once, like any credential, and rotated the same way.
  2. Add your egress IPs under Network → Allow-list (the allow-list applies to HTTP engines too).
  3. Use an official client (Node, Python, Go, Rust) or the HTTP pipeline API from anything else.

libSQL / SQLite listens on port 443 (HTTPS). Versions: 0.24. Replace the example host with the one on your instance's Connect tab; credentials are shown once at creation.

Connection URI
libsql://libsql-7f3k.us-east.databasezy.com?authToken=<token>
db.js
import { createClient } from "@libsql/client";
export const db = createClient({
url: "libsql://libsql-7f3k.us-east.databasezy.com", // TLS with a publicly trusted certificate
authToken: process.env.ZB_TOKEN,
});
const rs = await db.execute("select sqlite_version() as v");
console.log(rs.rows[0].v);

Tested with: libSQL / SQLite 0.24 · @libsql/client 0.14

The Node, Go and Rust clients can keep a local SQLite file in sync with the instance (syncUrl / Builder::new_remote_replica). Reads are then local and writes go to Databasezy. This is the recommended mode for edge and serverless runtimes with a filesystem.

  • One writer at a time (SQLite semantics); readers are unlimited.
  • Database size counts toward the instance’s storage; backups are file snapshots plus a WAL stream to object storage (“bottomless”) with point-in-time recovery.
  • No CA bundle is needed; the Java tab shows the HTTP pipeline for platforms without an official client.