simulate_trino: A Trino connection that never talks to a server

View source: R/dbplyr-simulate.R

simulate_trinoR Documentation

A Trino connection that never talks to a server

Description

Returns an object that carries the TrinoConnection class without holding a session, so sql_dialect.TrinoConnection() and, through it, sql_translation.sql_dialect_trino() dispatch as they would on a live connection. Useful for inspecting the SQL a dplyr pipeline produces, and used by this package's own translation tests, which then need no coordinator at all. Anything that reaches the database, such as collect(), still fails.

Usage

simulate_trino()

Value

A simulated dbplyr connection of class TrinoConnection.

Examples

if (requireNamespace("dbplyr", quietly = TRUE) &&
      utils::packageVersion("dbplyr") >= "2.6.0") {
  con <- simulate_trino()
  dbplyr::translate_sql(as.numeric(x), con = con)
}

RTrino documentation built on Oct. 15, 2026, 5:08 p.m.