tests/testthat/test-fetch.R

test_that("dbFetch() can fetch RETURNING statements (#3875)", {
  con <- dbConnect(duckdb())
  on.exit(dbDisconnect(con, shutdown = TRUE))

  dbCreateTable(con, "x", list(a = "int"))

  expect_silent(out <- dbGetQuery(con, "INSERT INTO x VALUES (1) RETURNING (a)"))
  expect_equal(out, data.frame(a = 1L))
})

Try the duckdb package in your browser

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

duckdb documentation built on Oct. 30, 2024, 5:06 p.m.