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)
rstats-db/RPostgres documentation built on April 20, 2024, 11:55 a.m.