tests/testthat/test_integer64.R

# this tests both retrieval and scans
test_that("we can roundtrip an integer64", {
  skip_if_not_installed("bit64")

  con <- dbConnect(duckdb(bigint = "integer64"))
  on.exit(dbDisconnect(con, shutdown = TRUE))
  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. 17, 2023, 5:08 p.m.