R/show_PqConnection.R

Defines functions show_PqConnection

Documented in show_PqConnection

# show()
#' @rdname PqConnection-class
#' @usage NULL
show_PqConnection <- function(object) {
  info <- dbGetInfo(object)

  if (info$host == "") {
    host <- "socket"
  } else {
    host <- paste0(info$host, ":", info$port)
  }

  cat("<PqConnection> ", info$dbname, "@", host, "\n", sep = "")
}

#' @rdname PqConnection-class
#' @export
setMethod("show", "PqConnection", show_PqConnection)

Try the RPostgres package in your browser

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

RPostgres documentation built on Oct. 23, 2023, 1:06 a.m.