LakeQL
Overview
  • Package Map
query-builder
  • Filtering
  • Sorting & Paging
  • API Reference
config
  • Runtime Config
  • API Reference
trino-client
  • Client Setup
  • Executing Queries
  • Streaming
  • Metadata
  • API Reference
fabric-client
  • Client Setup
  • Executing Queries
  • API Reference
GitHub
LakeQL
  1. Packages
  2. trino-client

trino-client

A standalone Trino REST client with streaming, cancellation, and retry.

@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-client
1
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.

Client Setup

Create and configure a TrinoClient.

Executing Queries

Run statements, collect results, and cancel in-flight queries.

Streaming

Stream large result sets one row at a time.

Metadata

Inspect catalogs, schemas, tables, and columns.

API Reference

Complete reference for the @lakeql/trino-client public API.

Previous page

API Reference

Next page

Client Setup