Skip to content

Commit

Permalink
feat: Default to bigint = "integer"
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Dec 16, 2023
1 parent 3dee8ee commit d6528b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions R/AdbiConnection.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,13 @@ DBI::dbWithTransaction

resolve_bigint <- function(x) {

has_bit64 <- requireNamespace("bit64", quietly = TRUE)

if (is.null(x)) {
if (has_bit64) {
x <- "integer64"
} else {
x <- "character"
}
x <- "integer"
}

res <- match.arg(x, c("integer", "numeric", "character", "integer64"))

if (res == "integer64" && !has_bit64) {
if (res == "integer64" && !requireNamespace("bit64", quietly = TRUE)) {
stop("Need to install bit64.", call. = FALSE)
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/helper-DBItest.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DBItest::make_context(
date_cast = function(x) paste0("'", x, "'"),
time_cast = function(x) paste0("'", x, "'"),
timestamp_cast = function(x) paste0("'", x, "'"),
logical_return = function(x) bit64::as.integer64(x),
logical_return = function(x) as.integer(x),
date_typed = FALSE,
time_typed = FALSE,
timestamp_typed = FALSE,
Expand Down

0 comments on commit d6528b4

Please sign in to comment.