Skip to main content

pack_database

Function pack_database 

Source
pub fn pack_database(
    dir: &Path,
    dest: &Path,
    options: &PackOptions,
) -> Result<PackResult, DatabaseError>
Expand description

Packs a database directory into one zip archive at dest: the files the database accounts for, stored without compression, plus the hayson-backup.json manifest and the caller’s extra entries. Databases named in include travel in the same archive under their folder, each with a <folder>/hayson-backup.json of its own; the main manifest lists their folders.

dest must not exist; the archive is built next to it and renamed into place. Every database is held under its writer lock while it is read, and one with an unfinished unit of work is refused, as in super::backup_database. Limits are enforced here too, so what is packed can be unpacked. History kept in a database of its own is not part of the database’s files.