tests/testthat/test-isTransacting.R

test_that("isTransacting detects transactions correctly", {
  skip_on_cran()
  con <- postgresDefault()
  expect_false(postgresIsTransacting(con))
  dbBegin(con)
  expect_true(postgresIsTransacting(con))
  dbCommit(con)
  expect_false(postgresIsTransacting(con))
})

Try the RPostgres package in your browser

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

RPostgres documentation built on Oct. 23, 2023, 1:06 a.m.