connect_to_pg: Create a pool connection to a PostgreSQL database either...

View source: R/connect_to_pg.R

connect_to_pgR Documentation

Create a pool connection to a PostgreSQL database either using a config file or environment variables If both exist, config file is given priority

Description

Create a pool connection to a PostgreSQL database either using a config file or environment variables If both exist, config file is given priority

Usage

connect_to_pg(
  config_file = here::here("config.yml"),
  config_value = "default",
  envars_prefix = "DEFAULT_DATABASE_",
  ...
)

Arguments

config_file

A yml config file with database credentials. Default is config.yml in root of project

config_value

The set of config vars to use from the config file

envars_prefix

The prefix of the environment variables to use to connect

...

Arguments passed to config::get

Value

A database connection object


Aypak/dbhelpers documentation built on Jan. 25, 2024, 9:03 p.m.