Browse Source

Added workplace scripts

master
Maxime Wack 6 years ago
parent
commit
7675fb6dbe
3 changed files with 37 additions and 0 deletions
  1. +1
    -0
      NAMESPACE
  2. +18
    -0
      R/workspace.R
  3. +18
    -0
      man/clear_default_workdata.Rd

+ 1
- 0
NAMESPACE View File

@@ -16,6 +16,7 @@ export(base_msg)
export(clear_default_demodata)
export(clear_default_imdata)
export(clear_default_metadata)
export(clear_default_workdata)
export(clear_table)
export(clear_webclient)
export(create_admin)


+ 18
- 0
R/workspace.R View File

@@ -0,0 +1,18 @@
#' Clear workspace tables
#'
#' Clear the workspace tables and inserts default values
#'
#' @param host The host to connect to
#' @param admin The admin account for the PostgreSQL database
#' @param pass the password for the admin account
#' @export
clear_default_workdata <- function(host = "", admin = "", pass = "")
{
c("workplace",
"workplace_access") %>%
purrr::walk(~clear_table("i2b2workdata", .x, host, admin, pass))

RPostgreSQL::dbConnect(RPostgreSQL::PostgreSQL(), host = host, dbname = "i2b2workdata", user = admin, password = pass) %>%
RPostgreSQL::dbGetQuery("INSERT INTO workplace_access values ('demo', 'WORKPLACE', 'N', '0', '@', '@', '@', 'N', '0',,'CA', '@', , , );")
}


+ 18
- 0
man/clear_default_workdata.Rd View File

@@ -0,0 +1,18 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/workspace.R
\name{clear_default_workdata}
\alias{clear_default_workdata}
\title{Clear workspace tables}
\usage{
clear_default_workdata(host = "", admin = "", pass = "")
}
\arguments{
\item{host}{The host to connect to}

\item{admin}{The admin account for the PostgreSQL database}

\item{pass}{the password for the admin account}
}
\description{
Clear the workspace tables and inserts default values
}

Loading…
Cancel
Save