https://github.com/wichert/pgarchive
Rust crate to read PostgreSQL custom archives
https://github.com/wichert/pgarchive
cargo postgresql postgresql-backup rust-library
Last synced: about 1 year ago
JSON representation
Rust crate to read PostgreSQL custom archives
- Host: GitHub
- URL: https://github.com/wichert/pgarchive
- Owner: wichert
- License: mit
- Created: 2023-09-28T08:08:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-25T20:45:48.000Z (over 1 year ago)
- Last Synced: 2025-03-24T09:52:48.544Z (over 1 year ago)
- Topics: cargo, postgresql, postgresql-backup, rust-library
- Language: Rust
- Homepage: https://crates.io/crates/pgarchive
- Size: 45.9 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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.
```rust
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),
};
```