R/create_pool.R

Defines functions create_pool

Documented in create_pool

#' Create a pool of connections
#'
#' Use a list of options (usually created through running \code{credentials_extract})
#' to create a pool of connections to the psql database.
#' @param options_list A list of options for connecting to a database, usually generated by calling \code{credentials_extract()}
#' @import RPostgreSQL
#' @import pool
#' @import DBI
#' @export

create_pool <- function(options_list){

  # Establish connection with database
  options_list$drv <- DBI::dbDriver("PostgreSQL")
  out <- do.call(dbPool, options_list)

  # Return the connection object
  return(out)
}
databrew/portfoliodash documentation built on May 3, 2019, 1:47 p.m.