Skip to content

Commit

Permalink
informative message if no prefix is supplied (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
catalamarti authored Feb 27, 2024
1 parent 0891823 commit 276aca8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions R/dbSource.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ dbSource <- function(con, writeSchema) {
}
checkmate::assert_character(writeSchema, min.len = 1, max.len = 3)

if (length(writeSchema) != 3 & !"schema" %in% names(writeSchema)) {
cli::cli_inform(c(
"!" = "No prefix was supplied.",
"Please consider using a prefix for good practices as it prevents:",
"*" = "Working in your own subschema",
"*" = "Dropping others tables",
"*" = "Easily clean it at the end of the analysis",
"To use a prefix you have to specify it when you create the cdm_reference:",
"v" = "writeSchema = c(schema = \"main\", prefix = \"my_prefix_\")"
))
}

source <- structure(
.Data = list(),
"dbcon" = con,
Expand Down

0 comments on commit 276aca8

Please sign in to comment.