1test_that("can work directly with DBI connection", { 2 skip_if_not_installed("RSQLite") 3 skip_if_not_installed("dbplyr") 4 5 con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 6 on.exit(DBI::dbDisconnect(con)) 7 8 df <- tibble(x = 1:10, y = letters[1:10]) 9 df1 <- copy_to(con, df) 10 df2 <- tbl(con, "df") 11 12 expect_equal(collect(df1), df, ignore_attr = TRUE) 13 expect_equal(collect(df2), df, ignore_attr = TRUE) 14}) 15