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. Endpoints
  3. Definition Format

On this page

  1. Name validation
  2. The dataSource field
  3. Minimal example

Definition Format

The top-level shape of an endpoint.json definition file.

LakeQL validates an endpoint.json file against a Zod schema at generation time. The top-level shape has six keys:

KeyRequiredTypeNotes
versionyesliteral "1.0"The only accepted value today.
catalogyesstringMust match the metadata name pattern below.
schemayesstringMust match the metadata name pattern below.
tableNameyesstringMust match the metadata name pattern below.
dataSourcenostringName of the configured data source this endpoint targets. Defaults to "default" when omitted.
fieldsyesarray of field definitionsSee Field Types and Nested Fields.
mutationnofalse or a mutation configSee Mutations.

Name validation #

catalog, schema, and tableName share one metadata pattern. It allows letters, digits, and underscores, with no leading digit, up to 128 characters:

1
2
/^[a-zA-Z_][a-zA-Z0-9_]{0,127}$/u

Field names (covered on the next page) use a related but stricter pattern, limited to 64 characters:

1
2
/^[a-zA-Z_][a-zA-Z0-9_]{0,63}$/u

The dataSource field #

dataSource names the entry in your lakeql.config.ts dataSources map that this endpoint queries against. It's optional. When omitted, generation targets the data source named "default". Set it explicitly whenever an endpoint belongs to a non-default data source, such as when a project configures more than one.

Minimal example #

A read-only endpoint with three flat fields and no mutation:

1
2
3
4
5
6
7
8
9
10
11
12
13
{
  "version": "1.0",
  "catalog": "hive",
  "schema": "sales",
  "tableName": "orders",
  "dataSource": "warehouse",
  "fields": [
    { "name": "id", "type": "Integer", "options": { "required": true } },
    { "name": "customerEmail", "type": "String" },
    { "name": "createdAt", "type": "DateTime" }
  ]
}

Run it through create-endpoint to generate the same config.ts, interface.ts, query-schema.ts, json-schema.json, and endpoint.json that pull would have produced for an equivalent live table. There's no mutation block, so no mutation-schema.ts is written.

pull does not write the dataSource it used into the generated endpoint.json — the field only flows into config.ts. If you recreate a pulled endpoint from its endpoint.json with create-endpoint --from-file (for example, re-running it for a Fabric data source), add the dataSource field back by hand first. Without it, generation falls back to the "default" data source and the Trino adapter.

Previous page

Endpoints

Next page

Field Types