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. Field Types

On this page

  1. Primitive types
  2. Field options
    1. Validation refinements

Field Types

The six primitive field types and field-level options.

Every entry in fields has a name (validated against the field name pattern from Definition Format), a type, and an optional options object. This page covers the six primitive types. Nested Fields covers Object and Array.

Primitive types #

TypeDescription
StringText value.
IntegerWhole number.
FloatDecimal number.
Booleantrue or false.
DateCalendar date without a time component.
DateTimeDate and time, with timezone handling owned by the adapter.
1
2
{ "name": "quantity", "type": "Integer" }

Field options #

options controls how a field behaves in the generated mutation input and in runtime validation. All keys are optional.

KeyTypeDefaultEffect
requiredbooleanfalseMarks the field required in mutation input.
readOnlybooleanfalseField appears in the query schema and Hive DDL but is excluded from the mutation input type.
validationsarray of validation refinements[]Zod refinements applied at runtime, see below.
1
2
3
4
5
6
{
  "name": "email",
  "type": "String",
  "options": { "required": true }
}
1
2
3
4
5
6
{
  "name": "internalId",
  "type": "String",
  "options": { "readOnly": true }
}

Validation refinements #

Each entry in validations is one of six kinds:

KindShapeUse
email{ "type": "email" }Validates an email address.
url{ "type": "url" }Validates a URL.
uuid{ "type": "uuid" }Validates a UUID.
min{ "type": "min", "value": number }Minimum numeric value or length.
max{ "type": "max", "value": number }Maximum numeric value or length.
regex{ "type": "regex", "pattern": string }Validates against a custom pattern.
1
2
3
4
5
6
7
8
9
{
  "name": "contactEmail",
  "type": "String",
  "options": {
    "required": true,
    "validations": [{ "type": "email" }]
  }
}
1
2
3
4
5
6
7
8
{
  "name": "website",
  "type": "String",
  "options": {
    "validations": [{ "type": "url" }]
  }
}
1
2
3
4
5
6
7
8
{
  "name": "externalId",
  "type": "String",
  "options": {
    "validations": [{ "type": "uuid" }]
  }
}
1
2
3
4
5
6
7
8
9
10
11
{
  "name": "quantity",
  "type": "Integer",
  "options": {
    "validations": [
      { "type": "min", "value": 1 },
      { "type": "max", "value": 1000 }
    ]
  }
}
1
2
3
4
5
6
7
8
{
  "name": "sku",
  "type": "String",
  "options": {
    "validations": [{ "type": "regex", "pattern": "^[A-Z]{3}-[0-9]{4}$" }]
  }
}

Previous page

Definition Format

Next page

Nested Fields