tests/testthat/test-ambiguous_prepare.R

test_that("Test ambiguous prepare statements", {
  con <- dbConnect(duckdb())
  on.exit(dbDisconnect(con, shutdown = TRUE))

  res <- dbGetQuery(con, "select ?", 42)
  expect_identical(res[[1]], 42)

  res <- dbGetQuery(con, "select ?", "hello world")
  expect_identical(res[[1]], "hello world")
})

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.