Crate postgresql_archive

Source
Expand description

§postgresql_archive

Code Coverage Benchmarks License Semantic Versioning

Retrieve and extract PostgreSQL on Linux, MacOS or Windows.

§Table of contents

§Examples

§Asynchronous API

use postgresql_archive::{extract, get_archive, Result, VersionReq };
use postgresql_archive::configuration::theseus;

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

§Synchronous API

#[cfg(feature = "blocking")] {
use postgresql_archive::configuration::theseus;
use postgresql_archive::VersionReq;
use postgresql_archive::blocking::{extract, get_archive};

let url = theseus::URL;
let (archive_version, archive) = get_archive(url, &VersionReq::STAR).unwrap();
let out_dir = std::env::temp_dir();
let result = extract(url, &archive, &out_dir).unwrap();
}

§Feature flags

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

The following features are available:

NameDescriptionDefault?
blockingEnables the blocking APINo
native-tlsEnables native-tls supportYes
rustls-tlsEnables rustls-tls supportNo

§Configurations

NameDescriptionDefault?
theseusEnables theseus PostgreSQL binariesYes
zonkyEnables zonky PostgreSQL binariesNo

§Hashers

NameDescriptionDefault?
md5Enables md5 hashersNo
sha1Enables sha1 hashersNo
sha2Enables sha2 hashersYes¹

¹ enabled by the theseus feature flag.

§Repositories

NameDescriptionDefault?
githubEnables github repositoryYes¹
mavenEnables maven repositoryNo

¹ enabled by the theseus feature flag.

§Supported platforms

postgresql_archive provides implementations for the following:

§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.

Modules§

Structs§

Enums§

  • PostgreSQL archive errors

Traits§

Functions§

Type Aliases§

  • PostgreSQL archive result type