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. Getting Started
  3. Environment

On this page

  1. Loading the Env File

Environment

Point your project at a data source through the environment.

A scaffolded project reads its connection details from environment variables. The lakeql.config.ts file references them. Copy the generated .env.example to .env and fill in your data source details:

1
2
cp .env.example .env
1
2
3
4
5
6
7
# .env — example for a Trino data source
TRINO_HOST=https://trino.example.com
TRINO_PORT=8080
TRINO_CATALOG=hive
TRINO_USERNAME=svc
TRINO_PASSWORD=...

The config reads these through a typed env object. This catches a missing or malformed value early, instead of failing mid-request.

1
2
3
4
5
6
7
8
// lakeql.config.ts (excerpt)
connection: {
  host: env.TRINO_HOST,
  port: env.TRINO_PORT,
  catalog: env.TRINO_CATALOG,
  auth: { type: "basic", username: env.TRINO_USERNAME, password: env.TRINO_PASSWORD },
}

Loading the Env File #

The server loads the env file on start. The generated dev script passes it to Node. The CLI loads it when you pass --env:

pnpm lakeql-cli pull --env .env
Keep .env out of version control, because it holds credentials. The scaffolded project gitignores it by default.

For the full configuration surface, see Configuration.

Previous page

Quickstart

Next page

First Run