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.

dest must not exist; the archive is built next to it and renamed into place. The directory is held under the writer lock while it is read, and a database 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 this database’s files.