Skip to contents

Opens a PostgreSQL database through RPostgres::Postgres(), optionally creates the tracking schema, and checks that all required tracking tables are present.

Usage

connect_postgres_tracking_db(..., initialize = FALSE)

Arguments

...

Connection arguments passed to DBI::dbConnect(), such as dbname, host, port, user, and password.

initialize

If TRUE, call create_schema() before checking required tables. Defaults to FALSE.

Value

A DBI connection.

Examples

if (FALSE) { # \dontrun{
con <- connect_postgres_tracking_db(
  dbname = "learnrtrackr",
  host = "localhost",
  user = "learnrtrackr",
  password = Sys.getenv("LEARNRTRACKR_POSTGRES_PASSWORD"),
  initialize = TRUE
)
DBI::dbDisconnect(con)
} # }