OHDSI / SqlRender
Showing 1 of 6 files from the diff.
Other files ignored by Codecov

@@ -183,9 +183,9 @@
Loading
183 183
#' @details
184 184
#' This function looks for a SQL file with the specified name in the inst/sql/<dbms> folder of the
185 185
#' specified package. If it doesn't find it in that folder, it will try and load the file from the
186 -
#' inst/sql/sql_server folder and use the \code{translate} function to translate it to the requested
187 -
#' dialect. It will subsequently call the \code{render} function with any of the additional specified
188 -
#' parameters.
186 +
#' inst/sql or inst/sql/sql_server folder and use the \code{translate} function to translate it to the 
187 +
#' requested dialect. It will subsequently call the \code{render} function with any of the additional 
188 +
#' specified parameters.
189 189
#'
190 190
#'
191 191
#' @param sqlFilename               The source SQL file
@@ -236,24 +236,19 @@
Loading
236 236
    )
237 237
    tempEmulationSchema <- oracleTempSchema
238 238
  }
239 -
  pathToSql <- system.file(paste("sql/", gsub(" ", "_", dbms), sep = ""),
240 -
    sqlFilename,
241 -
    package = packageName
242 -
  )
243 -
  mustTranslate <- !file.exists(pathToSql)
239 +
  pathToSql <- system.file("sql", gsub(" ", "_", dbms), sqlFilename, package = packageName)
240 +
  mustTranslate <- pathToSql == ""
244 241
  if (mustTranslate) {
245 242
    # If DBMS-specific code does not exists, load SQL Server code and translate after rendering
246 -
    pathToSql <- system.file(paste("sql/", "sql_server", sep = ""),
247 -
      sqlFilename,
248 -
      package = packageName
249 -
    )
250 -
    if (!file.exists(pathToSql)) {
251 -
      abort(paste0(
252 -
        "Cannot find '",
243 +
    pathToSql <- system.file("sql", "sql_server", sqlFilename, package = packageName)
244 +
    if (pathToSql == "") {
245 +
      pathToSql <- system.file("sql", sqlFilename, package = packageName)
246 +
    }
247 +
    if (pathToSql == "") {
248 +
      abort(sprintf(
249 +
        "Cannot find '%s' in the 'sql' or 'sql/sql_server' folder of the '%s' package.",
253 250
        sqlFilename,
254 -
        "' in the 'sql/sql_server' folder of the '",
255 -
        packageName,
256 -
        "' package."
251 +
        packageName
257 252
      ))
258 253
    }
259 254
  }
Files Coverage
R 80.73%
Project Totals (5 files) 80.73%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading