Created
August 16, 2018 03:21
-
-
Save kos59125/5c75ba5d6e0ec181d3fa8f5d3274c629 to your computer and use it in GitHub Desktop.
DB connection using config package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: | |
db: | |
drv: !expr RPostgres::Postgres() | |
host: localhost | |
password: password | |
user: user | |
dbname: dbname |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(DBI) | |
con <- do.call(dbConnect, config::get("db")) | |
# do stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment