Connect to database and return pool object
Usage
connect_to_db(
drv = RMySQL::MySQL(),
username = Sys.getenv("MYSQL_USERNAME"),
password = Sys.getenv("MYSQL_PASSWORD"),
host = Sys.getenv("MYSQL_HOST"),
port = 3306,
dbname,
...
)
Arguments
- drv
DBI-compatible database driver
- username
login username
- password
login password
- host
database hostname or IP
- port
database port
- dbname
name of database/table to use
- ...
Additional `poo::dbPool` options
Examples
if (FALSE) {
connect_to_db(drv = RMySQL::MySQL(), username = "root", password = "root")
}