Files
AVSDevR.DBClient/R/DBClientClass/dbSchema.R

22 lines
591 B
R

withSchema <- function(table_name) {
config <- private$client$getConfiguration()
if (exists("schema", config)) {
return(DBI::dbQuoteIdentifier(
getConnection(), DBI::Id(schema = config$schema, table = table_name)
))
} else {
return(DBI::dbQuoteIdentifier(
getConnection(), DBI::Id(table = table_name)
))
}
}
dplyrWithSchema <- function(table_name) {
config <- private$client$getConfiguration()
if (exists("schema", config) && !is.null(config$schema)) {
return(dbplyr::in_schema(config$schema, table_name))
} else {
return(table_name)
}
}