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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//! # postgresql_archive
//!
//! [](https://codecov.io/gh/theseus-rs/postgresql-embedded)
//! [](https://bencher.dev/perf/theseus-rs-postgresql-embedded)
//! [](https://github.com/theseus-rs/postgresql-embedded/tree/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, 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
//! ```no_run
//! #[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:
//!
//! | Name | Description | Default? |
//! |--------------|----------------------------|----------|
//! | `blocking` | Enables the blocking API | No |
//! | `native-tls` | Enables native-tls support | Yes |
//! | `rustls` | Enables rustls support | No |
//!
//! ### Configurations
//!
//! | Name | Description | Default? |
//! |-----------|-------------------------------------|----------|
//! | `theseus` | Enables theseus PostgreSQL binaries | Yes |
//! | `zonky` | Enables zonky PostgreSQL binaries | No |
//!
//! ### Extractors
//!
//! | Name | Description | Default? |
//! |----------|--------------------------|----------|
//! | `tar-gz` | Enables tar gz extractor | Yes |
//! | `tar-xz` | Enables tar xz extractor | No |
//! | `zip` | Enables zip extractor | No |
//!
//! ### Hashers
//!
//! | Name | Description | Default? |
//! |--------|----------------------|----------|
//! | `md5` | Enables md5 hashers | No |
//! | `sha1` | Enables sha1 hashers | No |
//! | `sha2` | Enables sha2 hashers | Yes¹ |
//!
//! ¹ enabled by the `theseus` feature flag.
//!
//! ### Repositories
//!
//! | Name | Description | Default? |
//! |----------|---------------------------|----------|
//! | `github` | Enables github repository | Yes¹ |
//! | `maven` | Enables maven repository | No |
//!
//! ¹ enabled by the `theseus` feature flag.
//!
//! ## Supported platforms
//!
//! `postgresql_archive` provides implementations for the following:
//!
//! * [theseus-rs/postgresql-binaries](https://github.com/theseus-rs/postgresql-binaries)
//! * [zonkyio/embedded-postgres-binaries](https://github.com/zonkyio/embedded-postgres-binaries)
//!
//! ## 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).
pub use ;
pub use ;
pub use ;
pub use ;