R/credentials_connect.R

Defines functions credentials_connect

Documented in credentials_connect

#' Create a connection to CISM's database
#'
#' Use a list of options (usually created through running \code{credentials_extract})
#' to create a connection to a CISM database.
#' @param options_list A list of options for connecting to a database, usually generated by calling \code{credentials_extract()}
#' @import dplyr
#' @export

# This function is used in conjunction with credentials_extract() (above)
# and fetch_db() (below)
credentials_connect <- function(options_list){

  # Establish connection with database
  connection_object <- do.call(src_mysql, options_list)

  # Return the connection object
  return(connection_object)
}
joebrew/cism documentation built on May 19, 2019, 2:58 p.m.