R/dbFetch_SQLiteResult.R

Defines functions dbFetch_SQLiteResult

Documented in dbFetch_SQLiteResult

#' @rdname SQLiteResult-class
#' @usage NULL
dbFetch_SQLiteResult <- function(res, n = -1, ...,
                                 row.names = pkgconfig::get_config("RSQLite::row.names.query", FALSE)) {
  row.names <- compatRowNames(row.names)
  if (length(n) != 1) stopc("`n` must be scalar")
  if (n < -1) stopc("`n` must be nonnegative or -1")
  if (is.infinite(n)) n <- -1
  if (trunc(n) != n) stopc("`n` must be a whole number")
  ret <- result_fetch(res@ptr, n = n)
  ret <- convert_bigint(ret, res@bigint)
  ret <- sqlColumnToRownames(ret, row.names)
  set_tidy_names(ret)
}
#' @rdname SQLiteResult-class
#' @export
setMethod("dbFetch", "SQLiteResult", dbFetch_SQLiteResult)

Try the RSQLite package in your browser

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

RSQLite documentation built on Nov. 5, 2023, 1:10 a.m.