stagingDataHelper: Data staging helper (internal) functions

stagingDataHelperR Documentation

Data staging helper (internal) functions

Description

A set of helper functions to aid staging of registry data at Rapporteket.

Usage

pathStagingData(registryName, dir)

wrapStagingData(data, key)

unwrapStagingData(data, key)

dbStagingData(key, drop = FALSE)

dbStagingPrereq(key)

dbStagingConnection(key = NULL, con = NULL, init = FALSE)

dbStagingProcess(key, query, params = list(), statement = FALSE)

Arguments

registryName

Character string providing the registry name.

dir

Character string providing the path to where the staging data directory resides in case of storage as files. Default value is Sys.getenv("R_RAP_CONFIG_PATH").

data

A data object that is to be added to or collected from staging.

key

Character string with key to be used for staging data store credentials.

drop

Logical defining if a database is to be deleted. FALSE by default.

con

A database connection object.

init

Logical defining if the function call will perform an initial set-up of a database. Default value is FALSE

query

Character string providing a database query.

params

List of values to be provided in a parameterized query.

statement

Logical defining if a query is a statement or not. Default value is FALSE.

Value

  • pathStagingData() returns a character string with the path to the staging directory of registryName. If its parent directory (dir) does not exists an error is returned.

  • dbStagingData() creates or drops a staging data database and returns a message invisibly.

  • dbStagingPrereq() ensures that a database for staging data is properly setup and returns a message, invisibly.

  • dbStagingConnection() returns an open database connection object or, when an open connection object is provided as an argument, closes it and returns NULL invisibly.

  • dbStagingProcess() returns the raw result of a database query based on the arguments provided.


Rapporteket/rapbase documentation built on Nov. 22, 2023, 9:21 p.m.