dbGetQuery-TrinoConnection-character-method: Run a query and return all of its rows

dbGetQuery,TrinoConnection,character-methodR Documentation

Run a query and return all of its rows

Description

Submits the statement, fetches every row and clears the result, even if fetching fails.

Usage

## S4 method for signature 'TrinoConnection,character'
dbGetQuery(conn, statement, n = -1, ...)

Arguments

conn

A TrinoConnection object.

statement

A single SQL statement.

n

Number of rows to return; -1 (the default) returns all of them.

...

Unused, for compatibility with the generic.

Value

A tibble.

Examples


con <- DBI::dbConnect(RTrino::Trino(), host = Sys.getenv("RTRINO_TEST_URL"),
                      catalog = "tpch", schema = "tiny")
DBI::dbGetQuery(con, "SELECT * FROM nation LIMIT 5")
DBI::dbGetQuery(con, "SELECT * FROM nation", n = 3)
DBI::dbDisconnect(con)


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