if (requireNamespace("RSQLite")) {
db <- src_sqlite(tempfile(), create = TRUE)
iris2 <- copy_to(db, iris)
mtcars$model <- rownames(mtcars)
mtcars2 <- copy_to(db, mtcars, indexes = list("model"))
explain(filter(mtcars2, model == "Hornet 4 Drive"))
# Note that tables are temporary by default, so they're not
# visible from other connections to the same database.
src_tbls(db)
db2 <- src_sqlite(db$path)
src_tbls(db2)
}
Run the code above in your browser using DataLab