@lakeql/trino-client is a standalone client for a Trino cluster. It talks to the Trino REST API using native fetch, with no external HTTP dependencies. It supports automatic result pagination, streaming via async generators, query cancellation, and configurable retry with exponential backoff.
The adapters use it under the hood. You can also use it directly whenever you need raw access to Trino.
Install it:
pnpm add @lakeql/trino-client1
2
3
4
5
6
7
8
9
10
11
import { TrinoClient } from "@lakeql/trino-client"
const client = new TrinoClient({
host: "http://localhost",
port: 8080,
auth: { type: "basic", username: "user", password: "secret" },
catalog: "hive",
})
const rows = await client.query({ sql: "SELECT 1" })
This section covers client setup, executing queries, streaming, and metadata. The full API reference comes at the end.