diff --git a/R/dbSource.R b/R/dbSource.R index fef0e082..00e27876 100644 --- a/R/dbSource.R +++ b/R/dbSource.R @@ -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.", @@ -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") }