I am trying to attach one SQLite database to another. On the terminal, I can do this pretty simply with the ATTACH
command, but I am working in an R script and I want to get it to work through a DBI connection. I have been able to attach with system calls, but it would be really nice to do it through a database connection.
DBI Connection try:
library(DBI)
NewDBFile <- "new.db"
archiveFile <- "archive.db"
con <- dbConnect(RSQLite::SQLite(), NewDBFile)
rs <- dbExecute(conn = con, paste0("ATTACH ", archiveFile, " AS archive;"))
dbDisconnect(con)
With this I get an "Error: no such column: [database name]"
Any ideas on how I would go about doing this?