R/db_information_schema.R

Defines functions db_information_schema

Documented in db_information_schema

#' Function to get schema information from a database. 
#' 
#' Only PostgreSQL databases are supported currently. 
#'
#' @author Stuart K. Grange
#' 
#' @param con Database connection. 
#' 
#' @export
db_information_schema <- function(con) {
  
  if (db_class(con) == "postgres") {
    df <- db_get(con, "SELECT * FROM INFORMATION_SCHEMA.COLUMNS")
  } else {
    cli::cli_abort("Not implemented.")
  }
  
  return(df)
  
}
skgrange/databaser documentation built on April 21, 2024, 6:30 a.m.