sqliteCopyDatabase

0th

Percentile

Copy a SQLite database

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.

Usage
sqliteCopyDatabase(from, to)
Arguments
from

A SQLiteConnection object. The main database in from will be copied to to.

to

A SQLiteConnection object pointing to an empty database.

References

http://www.sqlite.org/backup.html

Aliases
  • sqliteCopyDatabase
Examples
# NOT RUN {
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)
# }
Documentation reproduced from package RSQLite, version 2.0, License: LGPL (>= 2)

Community examples

Looks like there are no examples yet.