R/dbListTablesInSchema.R

Defines functions dbListTablesInSchema

Documented in dbListTablesInSchema

#' Lists all tables in a schema
#'
#' Lists all tables in a schema
#' @param con a connection to a database
#' @param schema a string representing a schema
#' @keywords organization efficiency
#' @export
#' @examples
#' dbGetTablesInSchema(olap, "metric_monitoring")

dbListTablesInSchema <- function(con, schema){
  query_text <- paste0("SELECT table_name FROM information_schema.tables
    WHERE table_schema = '", schema, "'")

  DBI::dbGetQuery(con, query_text)
}
Kidapt/keda documentation built on Oct. 12, 2019, 8:37 p.m.