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 June 22, 2024, 9:37 a.m.