Skip to content
Exposed docs1.11

Exposed Trino Adapter

Latest stable Based on Exposed release 1.11.0

bluetape4k-exposed-trino connects the Exposed JDBC DSL to a Trino coordinator and preserves Trino’s catalog/schema and autocommit boundaries.

Trino federates connectors rather than behaving like one transactional database. This adapter registers its JDBC dialect, validates connection options, removes unsupported primary-key DDL, and exposes coroutine bridges without pretending that a client block is atomic.

Use it to issue Exposed-built queries through Trino across catalogs. Treat supported DML and DDL as connector-specific capabilities, not guarantees of the coordinator.

dependencies {
implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<version>"))
implementation("io.github.bluetape4k.exposed:bluetape4k-exposed-trino")
}
  • TrinoDatabase.connect accepts host/port/catalog/schema, JDBC URL, or DataSource.
  • TrinoConnectionOptions owns typed JDBC properties.
  • TrinoConnectionWrapper keeps autocommit on; commit/rollback are no-ops.
  • TrinoTable removes primary-key and explicit nullable DDL while preserving NOT NULL.
val db = TrinoDatabase.connect(
host = "localhost", port = 8080,
catalog = "memory", schema = "default", user = "analyst",
)
transaction(db) { Events.selectAll().limit(100).toList() }
TaskAPI
Coordinator connectionTrinoDatabase.connect(...)
Pooled connectionTrinoDatabase.connect(dataSource)
Compatible simple DDLextend TrinoTable
Blocking JDBC on coroutine dispatchersuspendTransaction
Flow consumer APIqueryFlow

Design queries around a catalog’s pushdown behavior and inspect Trino query plans. Keep DML statements independent because a failure cannot roll back earlier work. Page in SQL; the adapter’s Flow bridge materializes rows before emitting them.

The Trino JDBC driver is an API dependency. Release tests use Testcontainers Trino with the memory connector and cover sanitized DDL, selects, inserts, validation, DataSource, and the lack of transaction atomicity.

The URL shape is jdbc:trino://host:port/catalog/schema. Configure credentials, SSL, roles, and session properties through TrinoConnectionOptions only after confirming coordinator policy. The production data source and its lifecycle remain application-owned.

  • transaction {} is a compatibility boundary, not an atomic unit.
  • Primary/unique/foreign-key behavior and DDL support vary by connector.
  • A query may scan more remote data than expected when predicate pushdown is unavailable.
  • Flow materialization can consume substantial heap for large results.

Track queued/running time, scanned bytes, remote read volume, retries, and coordinator errors. Set query limits and resource groups outside this adapter; cancel requests at both coroutine and Trino query levels where the application requires prompt termination.

Use a Trino container to test adapter mechanics, then add connector-specific integration tests for the production catalog. Do not infer BigQuery, Hive, or Iceberg behavior solely from the memory connector.

Compare the adapter in the database matrix and read OLTP vs OLAP. Validate one representative query and one unsupported write against the actual production connector before broad adoption.

Release 1.11 does not supply transactional atomicity, universal connector DDL, or true row-streaming Flow. The TrinoUnsupported annotation records known gaps but cannot discover connector capabilities at compile time.

These diagrams are loaded directly from README assets published with the 1.11.0 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.

Trino JDBC compatibility boundary diagram

Release README: exposed/trino/README.md

Trino Flow materialization contract diagram

Section titled “Trino Flow materialization contract diagram”

Trino Flow materialization contract diagram

Release README: exposed/trino/README.md