test_csv {DQAstats}R Documentation

test_csv helper function

Description

Internal function to test and get the database connection of the source database.

Usage

test_csv(settings, source_db, mdr, headless = FALSE, logfile_dir)

Arguments

settings

A list object containing the database settings.

source_db

A character string. The name of the source database. This string must be conform with the corresponding config section in the config.yml-file.

mdr

A data.table object containing the MDR.

headless

A boolean (default: FALSE). Indicating, if the function is run only in the console (headless = TRUE) or on a GUI frontend (headless = FALSE).

logfile_dir

The absolute path to folder where the logfile will be stored default(tempdir()).

Value

A boolean indicating if the CSV files specified in the metadata repository are found in the specified locations.

Examples

utils_path <- system.file(
  "demo_data/utilities/",
  package = "DQAstats"
)
mdr_filename <- "mdr_example_data.csv"
mdr <- read_mdr(
  utils_path = utils_path,
  mdr_filename = mdr_filename
)

source_system_name <- "exampleCSV_source"
target_system_name <- "exampleCSV_target"

DIZtools::cleanup_old_logfile(logfile_dir = tempdir())

settings <- DIZutils::get_config_env(
  system_name = source_system_name,
  logfile_dir = tempdir(),
  headless = TRUE
)

test_csv(
  settings = settings,
  source_db = source_system_name,
  mdr = mdr,
  headless = TRUE,
  logfile_dir = tempdir()
)



[Package DQAstats version 0.3.5 Index]