Nothing
#' Run a query and return all of its rows
#'
#' Submits the statement, fetches every row and clears the result, even if
#' fetching fails.
#'
#' @param conn A [TrinoConnection-class] object.
#' @param statement A single SQL statement.
#' @param n Number of rows to return; `-1` (the default) returns all of them.
#' @param ... Unused, for compatibility with the generic.
#'
#' @return A [tibble][tibble::tibble].
#' @export
#' @examplesIf nzchar(Sys.getenv("RTRINO_TEST_URL"))
#' 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)
setMethod(
"dbGetQuery", c("TrinoConnection", "character"),
function(conn, statement, n = -1, ...) {
res <- dbSendQuery(conn, statement, ...)
on.exit(dbClearResult(res), add = TRUE)
dbFetch(res, n = n)
}
)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.