tests/testthat/test-integer64.R

# this tests both retrieval and scans
test_that("we can roundtrip an integer64 via driver", {
  skip_if_not_installed("bit64")
  con <- local_con(bigint = "integer64")
  df <- data.frame(a = bit64::as.integer64(42), b = bit64::as.integer64(-42), c = bit64::as.integer64(NA))

  duckdb_register(con, "df", df)

  res <- dbReadTable(con, "df")
  expect_identical(df, res)
})

test_that("we can roundtrip an integer64 via dbConnect", {
  skip_if_not_installed("bit64")
  con <- local_con(bigint = "integer64")
  df <- data.frame(a = bit64::as.integer64(42), b = bit64::as.integer64(-42), c = bit64::as.integer64(NA))

  duckdb_register(con, "df", df)

  res <- dbReadTable(con, "df")
  expect_identical(df, res)
})

Try the duckdb package in your browser

Any scripts or data that you put into this service are public.

duckdb documentation built on Nov. 5, 2025, 5:41 p.m.