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")
  })
  defer(poolClose(pool))

  res <- DBI::dbGetQuery(pool, "PRAGMA journal_mode")[[1]]
  expect_equal(res, "truncate")
})
bborgesr/pool documentation built on Feb. 16, 2024, 2:48 a.m.