sqliteCopyDatabase {RSQLite} | R Documentation |
Copies a database connection to a file or to another database
connection. It can be used to save an in-memory database (created using
dbname = ":memory:"
or
dbname = "file::memory:"
) to a file or to create an in-memory database
a copy of another database.
sqliteCopyDatabase(from, to)
from |
A |
to |
A |
Seth Falcon
http://www.sqlite.org/backup.html
library(DBI) # Copy the built in databaseDb() to an in-memory database con <- dbConnect(RSQLite::SQLite(), ":memory:") dbListTables(con) db <- RSQLite::datasetsDb() RSQLite::sqliteCopyDatabase(db, con) dbDisconnect(db) dbListTables(con) dbDisconnect(con)