R/summary_DBIObject.R

Defines functions print_list_pairs summary_DBIObject

#' @usage NULL
summary_DBIObject <- function(object, ...) {
  info <- dbGetInfo(dbObj = object, ...)
  cat(class(object), "\n")
  print_list_pairs(info)
  invisible(info)
}

setMethod("summary", "DBIObject", summary_DBIObject)

print_list_pairs <- function(x, ...) {
  for (key in names(x)) {
    value <- format(x[[key]])
    if (identical(value, "")) next
    cat(key, "=", value, "\n")
  }
  invisible(x)
}

Try the DBI package in your browser

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

DBI documentation built on June 22, 2024, 9:41 a.m.