Skip to content

Commit

Permalink
feat: warn if user calls get_connection with untested driver
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Munch Grünewald authored and marcusmunch committed Sep 4, 2023
1 parent 8c3264f commit dcca91e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions R/connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ get_connection <- function(drv = RPostgres::Postgres(),
checkmate::assert_character(timezone, null.ok = TRUE)
checkmate::assert_character(timezone_out, null.ok = TRUE)

supported_drivers <- c(
"PqDriver",
"SQLiteDriver"
)

if (!class(drv) %in% supported_drivers) {
warning("Driver of class'", class(drv), "' is currently not fully supported and SCDB may not perform as expected.")
}

# Set PostgreSQL-specific options
if (inherits(drv, "PqDriver")) {
if (is.null(timezone)) timezone <- Sys.timezone()
Expand Down

0 comments on commit dcca91e

Please sign in to comment.