From d6528b4c1e7f21911ed79e39418c5a168def91de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sat, 16 Dec 2023 12:05:44 +0100 Subject: [PATCH] feat: Default to `bigint = "integer"` --- R/AdbiConnection.R | 10 ++-------- tests/testthat/helper-DBItest.R | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/R/AdbiConnection.R b/R/AdbiConnection.R index dc683ee..fc6bb05 100644 --- a/R/AdbiConnection.R +++ b/R/AdbiConnection.R @@ -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) } diff --git a/tests/testthat/helper-DBItest.R b/tests/testthat/helper-DBItest.R index b4c532e..9370923 100644 --- a/tests/testthat/helper-DBItest.R +++ b/tests/testthat/helper-DBItest.R @@ -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,