LakeQL
Overview
  • Introduction
  • Datasource Contract
  • API Reference
Writing
  • Write Strategies
  • Load Strategies
  • Partitioning
Storage
  • Storage Operations
Trino
  • Connection
  • Write Config
  • Metadata
  • API Reference
Fabric
  • Connection
  • Metadata
  • API Reference
GitHub
LakeQL
  1. Data Sources
  2. Trino
  3. Write Config

Write Config

The two writeConfig shapes the Trino adapter supports — INSERT and external storage.

The Trino adapter offers two write strategies, selected by the data source's writeConfig:

  • Storage (default) serializes records, uploads them to object storage, and registers them through Hive DDL. Select it when strategy is "storage" or omitted.
  • INSERT writes via INSERT INTO with no object storage. Select it with strategy: "insert" . It supports batching ( batchSize ), optional autoCreateTable , and tableProperties .

The INSERT strategy needs no object storage:

1
2
3
4
5
6
7
8
dataSources: {
  warehouse: {
    adapter: "trino",
    connection: { /* ... */ },
    writeConfig: { strategy: "insert", batchSize: 500 },
  },
}
NameType
strategyRequired"insert"

Discriminator selecting the INSERT strategy.

batchSize?number

Maximum number of rows per INSERT ... VALUES batch.

Default: 1000
autoCreateTable?boolean

When true, issue CREATE TABLE IF NOT EXISTS before appending, and use a pending-table swap for full_load.

Default: false
tableProperties?Record<string, string>

Optional table properties applied on table creation.

The storage strategy's fields are not LakeQL-native. The bucket, region, and credentials live on a files-sdk instance, so they are not part of the adapter's config type:

Object storage
The storage strategy writes Parquet files to object storage you provide.
SDK ownership
The bucket, region, and credentials live on a files-sdk instance, not on any LakeQL-native field. The Trino adapter's config has no bucket or credential keys.
Serialization
A serializer converts records to the storage file format before upload.

Construct both as live objects in lakeql.config.ts. They pass through to the write strategy as-is, not serialized:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Files } from "files-sdk"
import { s3 } from "files-sdk/s3"
import { parquetSerializer } from "@lakeql/storage/serializer/parquet"

dataSources: {
  warehouse: {
    adapter: "trino",
    connection: { /* ... */ },
    writeConfig: {
      // strategy defaults to "storage" when omitted
      files: new Files({ adapter: s3({ bucket: "warehouse", region: "eu-central-1" }) }),
      serializer: parquetSerializer(),
      // externalLocationPrefix?: override the auto-derived s3a://<bucket> prefix
      // keepShadowTables?: retain shadow tables after a successful swap
    },
  },
}
A storage write call without a resolved basePath throws before any file is uploaded.

See Writing for load-strategy semantics and the step-by-step pipeline, and TrinoWriteConfig for the full option set.

Previous page

Connection

Next page

Metadata