tests/testthat/test_320_stmt_insert.R

testthat::context("Statement Insert class")

testthat::test_that("We can generate a simple INSERT statement", {
  fields <- ExprListFields$new(list(ExprField$new("author"),
                                    ExprField$new("title")))
  x <- StmtInsert$new(tabl="books", fields=fields)
  testthat::expect_equal(x$toString(), 'INSERT INTO books (author, "title")')
})

Try the sqlq package in your browser

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

sqlq documentation built on Sept. 16, 2025, 9:10 a.m.