LakeQL
Introduction
  • Overview
  • Why LakeQL
  • Key Concepts
Getting Started
  • Prerequisites
  • Quickstart
  • Environment
  • First Run
Architecture
  • System Overview
  • Data Flow
  • Request Lifecycle
Configuration
  • Config File
  • Runtime Lifecycle
  • Environment Variables
create-app
  • Usage
  • Template Structure
  • Post-Creation
Guides
  • Custom Resolvers
  • Extending the Schema
  • Mutations
  • Set Up a Trino Mutation
  • Deploying
Endpoints
  • Definition Format
  • Field Types
  • Nested Fields
  • Mutations
  • Glossary
Contributing
  • Local Development
  • Contribution Guide
  • Architecture
GitHub
LakeQL
  1. LakeQL
  2. Configuration
  3. Environment Variables

On this page

  1. Loading the Env File
  2. Server Runtime Variables

Environment Variables

How environment values feed the config.

LakeQL does not impose a fixed set of environment variable names. Your lakeql.config.ts decides which variables it reads, typically through a typed env object. Those values are read directly when the config module is evaluated at load time.

1
2
3
4
5
6
7
8
9
10
11
12
// lakeql.config.ts — reads from a typed env module (e.g. @t3-oss/env-core + zod)
import { env } from "./src/env"

export default defineConfig({
  dataSources: {
    warehouse: {
      adapter: "trino",
      connection: { host: env.TRINO_HOST, port: env.TRINO_PORT /* ... */ },
    },
  },
})

A scaffolded project ships an env module and a .env.example file with the variables its chosen adapters need. Copy it to .env and fill it in. Validating the env with a schema makes a missing or malformed value fail fast at load time, with a clear message, instead of surfacing as a connection error later.

Loading the Env File #

  • Server — the generated dev/start scripts pass the env file to Node, so it is loaded before the config.
  • CLI — pass --env to load an env file before the config is read.

Server Runtime Variables #

Beyond your connection variables, the API server reads its own environment variables. All are optional with defaults:

VariableDefaultPurpose
API_LOGGERwarnServer log level.
API_MAX_RECORDS_PER_PAGE2000Max rows per paginated response.
API_PORT4000Server port.
NODE_ENVdevelopmentGates GraphiQL (enabled only in development).
AUTH_MOCKfalseEnables the development mock token resolver.
AUTH_MOCK_TOKEN—Token the mock resolver accepts when AUTH_MOCK=true.

The CLI reads LOG_LEVEL (default warn) for its own verbosity.

AUTH_MOCK=true disables real authentication and accepts any request bearing AUTH_MOCK_TOKEN. Use it only in local development, never in a deployed environment.

Treat the env file as secret — it holds credentials. Keep it out of version control.

Previous page

Runtime Lifecycle

Next page

create-app