# NOT RUN {
db <- tempfile()
with_db_connection(
list(con = DBI::dbConnect(RSQLite::SQLite(), db)), {
DBI::dbWriteTable(con, "mtcars", mtcars)
})
head_db_table <- function(...) {
con <- local_db_connection(DBI::dbConnect(RSQLite::SQLite(), db))
head(DBI::dbReadTable(con, "mtcars"), ...)
}
head_db_table()
unlink(db)
# }
Run the code above in your browser using DataCamp Workspace