View source: R/connect_to_pg.R
connect_to_pg | R 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
connect_to_pg(
config_file = here::here("config.yml"),
config_value = "default",
envars_prefix = "DEFAULT_DATABASE_",
...
)
config_file |
A yml config file with database credentials. Default is |
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 |
A database connection object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.