File: test-sql-df.R

package info (click to toggle)
dbi 1.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,004 kB
  • sloc: makefile: 2
file content (11 lines) | stat: -rw-r--r-- 254 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
test_that("NAs turn in NULLs", {
  df <- data.frame(
    x = c(1, NA),
    y = c("a", NA),
    stringsAsFactors = FALSE
  )
  sql_df <- sqlData(ANSI(), df)

  expect_equal(sql_df$x, SQL(c("1", "NULL")))
  expect_equal(sql_df$y, SQL(c("'a'", "NULL")))
})