Add comment/TODO about method we use to copy the db file

This commit is contained in:
PThorpe92
2025-08-05 12:49:24 -04:00
parent b131331673
commit 98f4e5cd2d

View File

@@ -1738,8 +1738,13 @@ impl Connection {
self.pager.borrow().clone()
}
/// Copy the current Database and write out to a new file
#[cfg(feature = "fs")]
/// Copy the current Database and write out to a new file.
/// TODO: sqlite3 instead essentially does the equivalent of
/// `.dump` and creates a new .db file from that.
///
/// Because we are instead making a copy of the File, as a side-effect we are
/// also having to checkpoint the database.
pub fn copy_db(&self, file: &str) -> Result<()> {
// use a new PlatformIO instance here to allow for copying in-memory databases
let io: Arc<dyn IO> = Arc::new(PlatformIO::new()?);