You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
722B

  1. #' Clear workspace tables
  2. #'
  3. #' Clear the workspace tables and inserts default values
  4. #'
  5. #' @param host The host to connect to
  6. #' @param admin The admin account for the PostgreSQL database
  7. #' @param pass the password for the admin account
  8. #' @export
  9. clear_default_workdata <- function(host = "", admin = "", pass = "")
  10. {
  11. c("workplace",
  12. "workplace_access") %>%
  13. purrr::walk(~clear_table("i2b2workdata", .x, host, admin, pass))
  14. RPostgreSQL::dbConnect(RPostgreSQL::PostgreSQL(), host = host, dbname = "i2b2workdata", user = admin, password = pass) %>%
  15. RPostgreSQL::dbGetQuery("INSERT INTO workplace_access values ('demo', 'WORKPLACE', 'N', '0', '@', '@', '@', 'N', '0', NULL, 'CA', '@', NULL, NULL, NULL);")
  16. }