get_yaml_file <- function(path) { append(list(),yaml::read_yaml(path)) }
list_databases <- function(in_project = TRUE) {
get_credentials <- function(path) {
get_yaml_file(paste0(path,"./credentials.yml"))
}
project_credentials <- get_credentials(getwd())
home_credentials <- get_credentials(Sys.getenv("USERPROFILE"))
names(home_credentials[(names(home_credentials) %in% names(project_credentials)) == in_project])
}
update_project_credentials <- function(path = getwd()) {
home_credentials <- get_yaml_file(paste0(Sys.getenv("USERPROFILE"),"./credentials.yml"))
uptodate_credentials <- home_credentials[list_databases(in_project = TRUE)]
yaml::write_yaml(home_credentials[list_databases(in_project = TRUE)],paste0(path,"./credentials.yml"))
}
update_home_credentials <- function(name, ...) {
home_credentials <- get_yaml_file(Sys.getenv("USERPROFILE"))
new_credentials <- list(...)
home_credentials[[name]] <- new_credentials
yaml::write_yaml(home_credentials )
}
add_database <- function(path, name) {
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.