Connecting to libSQL on Layerbase Cloud

libSQL exposes an HTTP-native SQLite-compatible database endpoint for apps that want lightweight SQL over the network.

Best for: SQLite-compatible apps, edge-friendly SQL, Turso-style client code, and lightweight relational workloads.

1

Open your database in the dashboard

Go to /cloud, click the database you just created, and the connection panel shows the host, port, username, password, and a ready-to-paste connection string for the engine.

Use the generated database URL and bearer token from the dashboard.

2

TLS is required, on by default

Use the https:// endpoint from Quick Connect.

libSQL HTTP API over HTTPS

3

Use any standard client

libSQL works with the normal client family for that engine. Start with the dashboard snippet, then move the same URL and credentials into your app environment.

If your client has separate direct, pooled, TLS, or HTTP options, prefer the exact variant shown in Quick Connect.

tslibSQL
const db = createClient({ url: 'https://your-host.cloud.layerbase.dev', authToken: process.env.LIBSQL_AUTH_TOKEN })

libSQL notes

  • Most Turso-compatible libSQL clients can use the same URL and token shape.
  • Keep write tokens server-side for production apps.