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
  3. Client Setup

On this page

  1. Authentication
  2. Optional Settings

Client Setup

Create and configure a TrinoClient.

Construct a TrinoClient with connection and authentication details to create a client.

1
2
3
4
5
6
7
8
9
import { TrinoClient } from "@lakeql/trino-client"

const client = new TrinoClient({
  host: "http://localhost",
  port: 8080,
  catalog: "hive",
  auth: { type: "basic", username: "user", password: "secret" },
})

Authentication #

The client supports two auth types:

1
2
3
4
5
6
// Basic auth
auth: { type: "basic", username: "user", password: "secret" }

// Bearer token
auth: { type: "bearer", token: "..." }

Optional Settings #

  • schema — a default schema, sent as the X-Trino-Schema header.
  • source — a source identifier ( X-Trino-Source ); defaults to "nodejs" .
  • timeout — a default per-query timeout in milliseconds.
  • retry — retry configuration (see RetryConfig ).
1
2
3
4
5
6
7
8
9
const client = new TrinoClient({
  host: "http://localhost",
  port: 8080,
  catalog: "hive",
  auth: { type: "basic", username: "user", password: "secret" },
  timeout: 30_000,
  retry: { maxRetries: 3 },
})

Previous page

trino-client

Next page

Executing Queries