From 202efb359f08c0896a1a09baf4ef7d9e671a9f12 Mon Sep 17 00:00:00 2001 From: mbarneytu Date: Mon, 31 Oct 2022 10:43:23 -0600 Subject: [PATCH] Switch fron .Renviron to config.yml for storing credentials --- R/database.R | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/R/database.R b/R/database.R index 38e739e..5b19e9b 100644 --- a/R/database.R +++ b/R/database.R @@ -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() {