1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
//! # postgresql_archive
//!
//! [](http://crates.io/crates/postgresql_archive)
//! [](https://docs.rs/postgresql_archive)
//! [](http://crates.io/crates/postgresql_archive)
//! [](https://github.com/theseus-rs/postgresql_embedded/blob/main/postgresql_archive/LICENSE)
//! [](https://semver.org/spec/v2.0.0.html)
//!
//! Retrieve and extract PostgreSQL on Linux, MacOS or Windows.
//!
//! ## Table of contents
//!
//! - [Examples](#examples)
//! - [Feature flags](#feature-flags)
//! - [Supported platforms](#supported-platforms)
//! - [Safety](#safety)
//! - [License](#license)
//! - [Notes](#notes)
//!
//! ## Examples
//!
//! ### Asynchronous API
//!
//! ```no_run
//! use postgresql_archive::{extract, get_archive, LATEST};
//!
//! #[tokio::main]
//! async fn main() {
//! let (archive_version, archive, hash) = get_archive(&LATEST).await.unwrap();
//! let out_dir = std::env::temp_dir();
//! let result = extract(&archive, &out_dir).await.unwrap();
//! }
//! ```
//!
//! ### Synchronous API
//! ```no_run
//! use postgresql_archive::LATEST;
//! use postgresql_archive::blocking::{extract, get_archive};
//!
//! let (archive_version, archive, hash) = get_archive(&LATEST).unwrap();
//! let out_dir = std::env::temp_dir();
//! let result = extract(&archive, &out_dir).unwrap();
//! ```
//!
//! ## 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](https://github.com/theseus-rs/postgresql-binaries):
//!
//! | OS | [Target](https://doc.rust-lang.org/nightly/rustc/platform-support.html) |
//! |---------|-------------------------------------------------------------------------|
//! | 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
//!
//! * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
//! * MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
//!
//! at your option.
//!
//! PostgreSQL is covered under [The PostgreSQL License](https://opensource.org/licenses/postgresql).
//!
//! ## Notes
//!
//! Uses PostgreSQL binaries from [theseus-rs/postgresql-binaries](https://github.com/theseus-rs/postgresql-binaries).
#![forbid(unsafe_code)]
#[macro_use]
extern crate lazy_static;
mod archive;
#[cfg(feature = "blocking")]
pub mod blocking;
mod error;
mod github;
mod version;
pub use archive::{extract, get_archive, get_archive_for_target, get_version};
pub use error::{ArchiveError, Result};
#[allow(deprecated)]
pub use version::{Version, LATEST, V12, V13, V14, V15, V16};