Skip to content

Commit

Permalink
only show message about write prefix if R is running interactively
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack3 committed Feb 27, 2024
1 parent 41c4a75 commit caacf28
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/dbSource.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dbSource <- function(con, writeSchema) {
}
checkmate::assert_character(writeSchema, min.len = 1, max.len = 3)

if (length(writeSchema) != 3 & !"schema" %in% names(writeSchema)) {
if (length(writeSchema) != 3 && interactive() && !("prefix" %in% names(writeSchema))) {

rlang::inform(c(
"No prefix was supplied. Consider adding a prefix in your write_schema.",
Expand All @@ -36,8 +36,7 @@ dbSource <- function(con, writeSchema) {
"*" = "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:",
"`write_schema = c(schema = \"main\", prefix = \"my_prefix_\")`"
),
"`write_schema = c(schema = \"main\", prefix = \"my_prefix_\")`"),
.frequency = "once",
.frequency_id = "write_prefix_message")
}
Expand Down

0 comments on commit caacf28

Please sign in to comment.