Skip to content

Commit

Permalink
Switch fron .Renviron to config.yml for storing credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarneytu committed Oct 31, 2022
1 parent 1b11f12 commit 202efb3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions R/database.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
library(pool)
library(shiny)
library(config)

# get values from config.yml using the config package
config <- config::get("dataconnection")

pool <- dbPool(
RMariaDB::MariaDB(),
dbname = Sys.getenv("HYDROP_DBNAME"),
host = Sys.getenv("HYDROP_HOST"),
user = Sys.getenv("HYDROP_USER"),
password = Sys.getenv("HYDROP_PWD")
RMariaDB::MariaDB(),
dbname = config$database,
host = config$server,
user = config$uid,
password = config$pwd
)

onStop(function() {
Expand Down

0 comments on commit 202efb3

Please sign in to comment.