R/connect.R

Defines functions connect

Documented in connect

#' Connects to a given database.
#'
#' @param dbname A database name, for example "oefenweb_nl_app" or "mathsgarden_com_app".
#' @param default.file A MySQL configuration file, containing login credentials.
#' @return A database connection (an object of class MySQLConnection).
#' @export
connect <- function(dbname = "oefenweb_nl_app", default.file = path.expand(file.path("~", ".my.cnf"))) {
  return(DBI::dbConnect(RMySQL::MySQL(), dbname = dbname, default.file = default.file))
}
Oefenweb/r-database documentation built on Feb. 21, 2020, 9:12 a.m.