3333# ' \code{connect} function in the \code{DatabaseConnector} package.
3434# ' Either the \code{connection} or \code{connectionDetails} argument
3535# ' should be specified.
36- # ' @param oracleTempSchema A schema where temp tables can be created in Oracle .
36+ # ' @param oracleTempSchema DEPRECATED: use \code{tempEmulationSchema} instead .
3737# ' @param cdmDatabaseSchema The name of the database schema that contains the OMOP CDM instance.
3838# ' Requires read permissions to this database. On SQL Server, this should
3939# ' specify both the database and the schema, so for example
6666# ' @param minCharacterizationMean The minimum mean value for characterization output. Values below this will be cut off from output. This
6767# ' will help reduce the file size of the characterization output, but will remove information
6868# ' on covariates that have very low values. The default is 0.
69+ # ' @param tempEmulationSchema Some database platforms like Oracle and Impala do not truly support
70+ # ' temp tables. To emulate temp tables, provide a schema with write
71+ # ' privileges where temp tables can be created.
6972# '
7073# ' @return
7174# ' Returns an object of type \code{covariateData}, containing information on the covariates.
8285# ' )
8386# ' covData <- getDbCovariateData(
8487# ' connectionDetails = eunomiaConnectionDetails,
85- # ' oracleTempSchema = NULL,
88+ # ' tempEmulationSchema = NULL,
8689# ' cdmDatabaseSchema = "main",
8790# ' cdmVersion = "5",
8891# ' cohortTable = "cohort",
@@ -109,7 +112,8 @@ getDbCovariateData <- function(connectionDetails = NULL,
109112 rowIdField = " subject_id" ,
110113 covariateSettings ,
111114 aggregated = FALSE ,
112- minCharacterizationMean = 0 ) {
115+ minCharacterizationMean = 0 ,
116+ tempEmulationSchema = NULL ) {
113117 if (is.null(connectionDetails ) && is.null(connection )) {
114118 stop(" Need to provide either connectionDetails or connection" )
115119 }
@@ -123,6 +127,13 @@ getDbCovariateData <- function(connectionDetails = NULL,
123127 warning(" cohortId argument has been deprecated, please use cohortIds" )
124128 cohortIds <- cohortId
125129 }
130+ if (! is.null(oracleTempSchema ) && oracleTempSchema != " " ) {
131+ rlang :: warn(" The 'oracleTempSchema' argument is deprecated. Use 'tempEmulationSchema' instead." ,
132+ .frequency = " regularly" ,
133+ .frequency_id = " oracleTempSchema"
134+ )
135+ tempEmulationSchema <- oracleTempSchema
136+ }
126137 errorMessages <- checkmate :: makeAssertCollection()
127138 minCharacterizationMean <- utils :: type.convert(minCharacterizationMean , as.is = TRUE )
128139 checkmate :: assertNumeric(x = minCharacterizationMean , lower = 0 , upper = 1 , add = errorMessages )
@@ -149,7 +160,7 @@ getDbCovariateData <- function(connectionDetails = NULL,
149160 sql <- SqlRender :: translate(
150161 sql = sql ,
151162 targetDialect = attr(connection , " dbms" ),
152- oracleTempSchema = oracleTempSchema
163+ tempEmulationSchema = tempEmulationSchema
153164 )
154165 temp <- DatabaseConnector :: querySql(connection , sql , snakeCaseToCamelCase = TRUE )
155166 if (aggregated ) {
@@ -174,7 +185,7 @@ getDbCovariateData <- function(connectionDetails = NULL,
174185 fun <- attr(covariateSettings [[i ]], " fun" )
175186 args <- list (
176187 connection = connection ,
177- oracleTempSchema = oracleTempSchema ,
188+ tempEmulationSchema = tempEmulationSchema ,
178189 cdmDatabaseSchema = cdmDatabaseSchema ,
179190 cohortTable = cohortDatabaseSchemaTable ,
180191 cohortIds = cohortIds ,
0 commit comments