Skip to content

Commit

Permalink
message about prefix. only show it once.
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack3 committed Feb 27, 2024
1 parent 276aca8 commit a8bbbc2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions R/dbSource.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,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",

rlang::inform(c(
"No prefix was supplied. Consider adding a prefix in your write_schema.",
"A prefix",
"*" = "Allows you to work in your own subschema",
"*" = "Helps Prevent accidentally dropping tables of others using the same database schema",
"*" = "Allows you to easily clean up intermediate tables 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_\")"
))
"`write_schema = c(schema = \"main\", prefix = \"my_prefix_\")`"
),
.frequency = "once",
.frequency_id = "write_prefix_message")
}

source <- structure(
Expand Down

0 comments on commit a8bbbc2

Please sign in to comment.