Skip to content

Commit 4d977d4

Browse files
Merge pull request #194 from theseus-rs/add-extractor-feature-flags
feat: add extractor feature flags
2 parents 1bde26b + 60cd2a3 commit 4d977d4

File tree

6 files changed

+44
-8
lines changed

6 files changed

+44
-8
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postgresql_archive/Cargo.toml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version.workspace = true
1212

1313
[dependencies]
1414
async-trait = { workspace = true }
15-
flate2 = { workspace = true }
15+
flate2 = { workspace = true, optional = true }
1616
futures-util = { workspace = true }
1717
hex = { workspace = true }
1818
liblzma = { workspace = true, optional = true }
@@ -29,15 +29,15 @@ serde = { workspace = true, features = ["derive"] }
2929
serde_json = { workspace = true, optional = true }
3030
sha1 = { workspace = true, optional = true }
3131
sha2 = { workspace = true, optional = true }
32-
tar = { workspace = true }
32+
tar = { workspace = true, optional = true }
3333
target-triple = { workspace = true, optional = true }
3434
tempfile = { workspace = true }
3535
thiserror = { workspace = true }
3636
tokio = { workspace = true, features = ["full"], optional = true }
3737
tracing = { workspace = true, features = ["log"] }
3838
tracing-indicatif = { workspace = true, optional = true }
3939
url = { workspace = true }
40-
zip = { workspace = true }
40+
zip = { workspace = true, optional = true }
4141

4242
[dev-dependencies]
4343
anyhow = { workspace = true }
@@ -70,14 +70,27 @@ native-tls = ["reqwest/native-tls"]
7070
rustls = ["reqwest/rustls-tls-native-roots"]
7171
sha1 = ["dep:sha1"]
7272
sha2 = ["dep:sha2"]
73+
tar-gz = [
74+
"dep:flate2",
75+
"dep:tar",
76+
]
77+
tar-xz = [
78+
"dep:liblzma",
79+
"dep:tar",
80+
]
7381
theseus = [
7482
"dep:target-triple",
7583
"github",
7684
"sha2",
85+
"tar-gz",
86+
]
87+
zip = [
88+
"dep:zip",
7789
]
7890
zonky = [
7991
"maven",
80-
"liblzma"
92+
"tar-xz",
93+
"zip",
8194
]
8295

8396
[package.metadata.docs.rs]

postgresql_archive/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ The following features are available:
6363
| `theseus` | Enables theseus PostgreSQL binaries | Yes |
6464
| `zonky` | Enables zonky PostgreSQL binaries | No |
6565

66+
### Extractors
67+
68+
| Name | Description | Default? |
69+
|----------|----------------------|----------|
70+
| `tar-gz` | Enables md5 hashers | Yes |
71+
| `tar-xz` | Enables sha1 hashers | No |
72+
| `zip` | Enables sha2 hashers | No |
73+
6674
### Hashers
6775

6876
| Name | Description | Default? |
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
mod model;
22
pub mod registry;
3+
#[cfg(feature = "tar-gz")]
34
mod tar_gz_extractor;
4-
#[cfg(feature = "liblzma")]
5+
#[cfg(feature = "tar-xz")]
56
mod tar_xz_extractor;
7+
#[cfg(feature = "zip")]
68
mod zip_extractor;
79

810
pub use model::ExtractDirectories;
11+
#[cfg(feature = "tar-gz")]
912
pub use tar_gz_extractor::extract as tar_gz_extract;
10-
#[cfg(feature = "liblzma")]
13+
#[cfg(feature = "tar-xz")]
1114
pub use tar_xz_extractor::extract as tar_xz_extract;
15+
#[cfg(feature = "zip")]
1216
pub use zip_extractor::extract as zip_extract;

postgresql_archive/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@
6868
//! | `theseus` | Enables theseus PostgreSQL binaries | Yes |
6969
//! | `zonky` | Enables zonky PostgreSQL binaries | No |
7070
//!
71+
//! ### Extractors
72+
//!
73+
//! | Name | Description | Default? |
74+
//! |----------|----------------------|----------|
75+
//! | `tar-gz` | Enables md5 hashers | Yes |
76+
//! | `tar-xz` | Enables sha1 hashers | No |
77+
//! | `zip` | Enables sha2 hashers | No |
78+
//!
7179
//! ### Hashers
7280
//!
7381
//! | Name | Description | Default? |

postgresql_extensions/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,17 @@ blocking = ["tokio"]
4343
portal-corp = [
4444
"dep:target-triple",
4545
"postgresql_archive/github",
46+
"postgresql_archive/zip",
4647
]
4748
steampipe = [
4849
"dep:serde_json",
4950
"postgresql_archive/github",
51+
"postgresql_archive/tar-gz",
5052
]
5153
tensor-chord = [
5254
"dep:target-triple",
5355
"postgresql_archive/github",
56+
"postgresql_archive/zip",
5457
]
5558
tokio = [
5659
"postgresql_commands/tokio",

0 commit comments

Comments
 (0)