LakeQL
Introduction
  • Overview
  • Key Concepts
  • Package Map
Getting Started
  • Prerequisites
  • Quickstart
  • Environment Configuration
  • First Run
Architecture
  • System Overview
  • Data Flow
  • Request Lifecycle
Configuration
  • Environment Variables
  • Authentication
  • Trino Connection
create-app
  • Usage
  • Template Structure
  • Post Creation
Contributing
  • Local Development
  • Contribution Guide
Guides
  • Custom Resolvers
  • Extending Schema
  • Deploying
  • Mutations
  • Load Strategies
GitHub
LakeQL
  1. LakeQL
  2. Configuration
  3. Environment Variables

On this page

  1. Overview
  2. Complete Reference
  3. Validation Skip Conditions
  4. Programmatic Configuration

Environment Variables

Complete reference for all environment variables used across LakeQL packages.

Overview #

LakeQL validates environment variables at startup using @t3-oss/env-core with Zod schemas. Missing or invalid values cause an immediate, descriptive failure so misconfiguration is caught before the server starts handling requests.

Complete Reference #

VariablePackageTypeRequiredDefaultDescription
HIVE_HOSTapi, clistringYes—Trino host URL (e.g. http://localhost)
HIVE_PORTapi, clinumberYes—Trino HTTP port (e.g. 8080)
HIVE_USERNAMEapi, clistringYes—Trino authentication username
HIVE_PASSWORDapi, clistringYes—Trino authentication password
HIVE_CATALOGapi, clistringYes—Default Trino catalog (e.g. hive)
HIVE_SOURCEapi, clistringNo—Value for X-Trino-Source header
API_PORTapinumberNo4000GraphQL API server port
API_LOGGERapienumNowarnLog level: silent, debug, info, warn, error
API_MAX_RECORDS_PER_PAGEapinumberNo2000Maximum records per paginated response
AUTH_MOCKapibooleanNofalseEnable mock authentication
AUTH_MOCK_TOKENapistringNo—Token for mock auth (checked against Authorization header)
NODE_ENVapienumNodevelopmentEnvironment: development, production, test

Validation Skip Conditions #

Environment validation is skipped when:

  • Running in CI ( CI env var is set)
  • Running npm run lint or npm run test lifecycle events

This allows tooling like linters and type checkers to run without requiring a full .env file.

Programmatic Configuration #

Many settings can also be overridden programmatically via defineConfig:

1
2
3
4
5
6
7
8
9
10
11
import { defineConfig } from "@lakeql/api"
import { allConfigs } from "./config-registry"

export default defineConfig({
  allConfigs,
  port: 3000, // Overrides API_PORT
  maxRecordsPerPage: 500, // Overrides API_MAX_RECORDS_PER_PAGE
  graphqlPath: "/api/graphql", // Custom GraphQL endpoint path
  healthCheckEndpoint: "/live", // Health check path
})

Programmatic values take precedence over environment variables for runtime configuration like port, maxRecordsPerPage, graphqlPath, and healthCheckEndpoint.

Previous page

Configuration

Next page

Authentication