#postgresql #database-server #embedded-database #server #embedded

postgresql_archive

A library for downloading and extracting PostgreSQL archives

27 releases (8 breaking)

new 0.9.2 May 19, 2024
0.9.0 Apr 26, 2024
0.7.3 Mar 25, 2024

#1073 in Database interfaces

Download history 418/week @ 2024-02-10 272/week @ 2024-02-17 396/week @ 2024-02-24 322/week @ 2024-03-02 720/week @ 2024-03-09 721/week @ 2024-03-16 313/week @ 2024-03-23 605/week @ 2024-03-30 246/week @ 2024-04-06 129/week @ 2024-04-13 339/week @ 2024-04-20 428/week @ 2024-04-27 110/week @ 2024-05-04 51/week @ 2024-05-11

945 downloads per month
Used in 3 crates (2 directly)

(Apache-2.0 OR MIT) AND PostgreSQL

49KB
780 lines

PostgreSQL Archive

ci Documentation Code Coverage Benchmarks Latest version License Semantic Versioning

A library for downloading and extracting PostgreSQL archives from theseus-rs/postgresql-binaries.

Examples

Asynchronous API

use postgresql_archive::{extract, get_archive, Result, LATEST};

#[tokio::main]
async fn main() -> Result<()> {
    let (archive_version, archive) = get_archive(&LATEST).await?;
    let out_dir = std::env::temp_dir();
    extract(&archive, &out_dir).await
}

Synchronous API

use postgresql_archive::{Result, LATEST};
use postgresql_archive::blocking::{extract, get_archive};

fn main() -> Result<()> {
    let (archive_version, archive) = get_archive(&LATEST)?;
    let out_dir = std::env::temp_dir();
    extract(&archive, &out_dir)
}

Feature flags

postgresql_archive uses [feature flags] to address compile time and binary size uses.

The following features are available:

Name Description Default?
blocking Enables the blocking API No

Supported platforms

postgresql_archive supports all platforms provided by theseus-rs/postgresql-binaries.

Currently supported platforms are:

OS Target
Linux aarch64-unknown-linux-gnu
Linux aarch64-unknown-linux-musl
Linux arm-unknown-linux-gnueabi
Linux arm-unknown-linux-gnueabihf
Linux arm-unknown-linux-musleabi
Linux arm-unknown-linux-musleabihf
Linux armv5te-unknown-linux-gnueabi
Linux armv7-unknown-linux-gnueabihf
Linux armv7-unknown-linux-musleabihf
Linux i586-unknown-linux-gnu
Linux i586-unknown-linux-musl
Linux i686-unknown-linux-gnu
Linux i686-unknown-linux-musl
Linux mips64-unknown-linux-gnuabi64
Linux powerpc64le-unknown-linux-gnu
Linux powerpc64le-unknown-linux-musl
Linux s390x-unknown-linux-gnu
Linux s390x-unknown-linux-musl
Linux x86_64-unknown-linux-gnu
Linux x86_64-unknown-linux-musl
MacOS aarch64-apple-darwin
MacOS x86_64-apple-darwin
Windows x86_64-pc-windows-msvc

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

License

Licensed under either of

at your option.

PostgreSQL is covered under The PostgreSQL License.

Notes

Uses PostgreSQL binaries from theseus-rs/postgresql-binaries.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~11–25MB
~418K SLoC