R/dbHasCompleted.R

#' Have all rows of a result been consumed?
#'
#' `TRUE` once Trino has stopped handing out pages *and* the rows already
#' pulled have been handed to the caller. A result that has finished on the
#' server but still holds buffered rows is not complete, so a
#' `while (!dbHasCompleted(res))` loop over [dbFetch()] sees every row.
#'
#' @param res A [TrinoResult-class] object.
#' @param ... Unused, for compatibility with the generic.
#' @return A logical scalar.
#' @export
setMethod("dbHasCompleted", "TrinoResult", function(res, ...) {
  isTRUE(res@state$completed) && length(res@state$data) == 0L
})

Try the RTrino package in your browser

Any scripts or data that you put into this service are public.

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