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
strategyis"storage"or omitted. -
INSERT
writes via
INSERT INTOwith no object storage. Select it withstrategy: "insert". It supports batching (batchSize), optionalautoCreateTable, andtableProperties.
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 },
},
}
| Name | Type |
|---|---|
| strategyRequired | "insert" |
Discriminator selecting the INSERT strategy. | |
| batchSize? | number |
Maximum number of rows per INSERT ... VALUES batch. 1000 | |
| autoCreateTable? | boolean |
When true, issue CREATE TABLE IF NOT EXISTS before appending, and use a pending-table swap for full_load. 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-sdkinstance, 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
},
},
}
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.