Connect to a PostgreSQL database with a config.yml file.

sbf_open_pg(
  config_path = getOption("psql.config_path", NULL),
  config_value = getOption("psql.config_value", "default")
)

Arguments

config_path

A string of a file path to the yaml configuration file. The default value grabs the file path from the psql.config_path option and uses NULL if no value supplied.

config_value

A string of the name of value. The default value grabs the value from the psql.config_value option and uses "default" if no value is supplied.

Value

An S4 object that inherits from DBIConnection.

Details

Wrapper on psql::psql_connect()

Examples

if (FALSE) { # \dontrun{
conn <- sbf_open_pg()
sbf_close_pg(conn)

sbf_open_pg("config.yml")
sbf_close_pg(conn)

sbf_open_pg(config_path = "config.yml", config_value = "database")
sbf_close_pg(conn)
} # }