pgarchive

Crates.iopgarchive
lib.rspgarchive
version0.3.0
sourcesrc
created_at2023-10-02 20:32:31.382073
updated_at2023-10-04 19:21:14.761194
descriptionRead PostgreSQL custom format archives
homepagehttps://github.com/wichert/pgarchive
repositoryhttps://github.com/wichert/pgarchive
max_upload_size
id990457
size59,934
Wichert Akkerman (wichert)

documentation

https://docs.rs/pgarchive/

README

Parser for PostgreSQL dumps in custom format

This crate allows inspecting the contents of a PostgreSQL backup as made using pg_dump -Fc or pg_dump --format=custom, and provides direct access all raw table data. This can be useful if you do not trust the SQL statements embedded in the dump, or if you want to process data without loading it into a database.

use std::fs::File;
use pgarchive::Archive;

let mut file = File::open("tests/test.pgdump").unwrap();
match Archive::parse(&mut file) {
    Ok(archive) => println!("This is a backup of {}", archive.database_name),
    Err(e) => println!("can not read file: {:?}", e),
};
Commit count: 35

cargo fmt