wtree Cloud

Connect to libSQL

Reach a wtree Cloud libSQL database over HTTP with basic auth, from another service or from your machine.

libSQL uses HTTP basic authentication with the service's Database User and Database Password.

From another service

Use the Internal connection URL from the Overview tab. The host is the app name and the port is 8080:

LIBSQL_URL=http://<app-name>:8080
LIBSQL_USER=libsql
LIBSQL_PASSWORD=<password>

From your machine

Open your libSQL database.

Under External credentials, enter an External port (internet) not used by another service, for example 8080, and click Save.

Copy the connection URL shown under External host, for example http://libsql:[email protected]:8080.

Verify

curl -u libsql:password http://1.2.3.4:8080/health

Run a statement through the pipeline endpoint on the same port:

curl -u libsql:password http://1.2.3.4:8080/v2/pipeline \
  -H "Content-Type: application/json" \
  -d '{"requests":[{"type":"execute","stmt":{"sql":"SELECT 1"}},{"type":"close"}]}'

wtree Cloud configures HTTP basic auth. Client libraries that only accept an auth token send a bearer token, so configure them to send an Authorization: Basic header.

Next steps

On this page