Skip to contents

To connect to the database

Usage

connect_db(
  dbname = "postgres",
  host = Sys.getenv("DB_HOST", unset = ""),
  port = 6543,
  user = Sys.getenv("DB_USER", unset = ""),
  password = Sys.getenv("DB_PWD", unset = "")
)

Arguments

dbname

name of db

host

host of db

port

port of db

user

user of db

password

password of db

Examples

if (interactive()) {
  connect_db()
}