tests/testthat/test-DBI.R

test_that("can set options on creation", {
  pool <- dbPool(RSQLite::SQLite(), onCreate = function(con) {
    DBI::dbExecute(con, "PRAGMA journal_mode = TRUNCATE")
  })
  withr::defer(poolClose(pool))

  res <- DBI::dbGetQuery(pool, "PRAGMA journal_mode")[[1]]
  expect_equal(res, "truncate")
})

Try the pool package in your browser

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

pool documentation built on March 7, 2023, 6:49 p.m.