A set of helper functions to aid staging of registry data at Rapporteket.
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)
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.
Character string providing the registry name.
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")
.
A data object that is to be added to or collected from staging.
Character string with key to be used for staging data store credentials.
Logical defining if a database is to be deleted. FALSE by default.
A database connection object.
Logical defining if the function call will perform an initial set-up of a database. Default value is FALSE
Character string providing a database query.
List of values to be provided in a parameterized query.
Logical defining if a query is a statement or not. Default value is FALSE.