uploadResultsToDatabase: Upload results to the database server.

View source: R/BackendDatabase.R

uploadResultsToDatabaseR Documentation

Upload results to the database server.

Description

Requires the results data model tables have been created using the createResultsDataModel function.

Set the POSTGRES_PATH environmental variable to the path to the folder containing the psql executable to enable bulk upload (recommended).

Usage

uploadResultsToDatabase(
  connectionDetails,
  schema,
  zipFileName,
  specifications,
  forceOverWriteOfSpecifications = FALSE,
  purgeSiteDataBeforeUploading = FALSE,
  convertFromCamelCase = FALSE,
  replaceInfinities = NULL,
  tempFolder = tempdir()
)

Arguments

connectionDetails

Object of type connectionDetails as created using the createConnectionDetails function in the DatabaseConnector package.

schema

Schema on the postgres server where the tables have been created.

zipFileName

Name of single or vector of multiple zip files.

specifications

Specification of results tables

forceOverWriteOfSpecifications

If TRUE, specifications of the phenotypes, cohort definitions, and analysis will be overwritten if they already exist on the database. Only use this if these specifications have changed since the last upload.

purgeSiteDataBeforeUploading

If TRUE, before inserting data for a specific databaseId all the data for that site will be dropped. This assumes the input zip file contains the full data for that data site.

convertFromCamelCase

Convert column names from camelCase to snake_case when uploading?

replaceInfinities

Value to which to change infinities, NULL does not change .

tempFolder

Folder on the local file system where the zip files are extracted to. Will be cleaned up when the function is finished. Can be used to specify a temp folder on a drive that has sufficient space if the default system temp space is too limited.


ohdsi-studies/LegendT2dm documentation built on July 4, 2025, 8:25 p.m.