Skip to content

feat: add extractor feature flags #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions postgresql_archive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ version.workspace = true

[dependencies]
async-trait = { workspace = true }
flate2 = { workspace = true }
flate2 = { workspace = true, optional = true }
futures-util = { workspace = true }
hex = { workspace = true }
liblzma = { workspace = true, optional = true }
Expand All @@ -29,15 +29,15 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, optional = true }
sha1 = { workspace = true, optional = true }
sha2 = { workspace = true, optional = true }
tar = { workspace = true }
tar = { workspace = true, optional = true }
target-triple = { workspace = true, optional = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"], optional = true }
tracing = { workspace = true, features = ["log"] }
tracing-indicatif = { workspace = true, optional = true }
url = { workspace = true }
zip = { workspace = true }
zip = { workspace = true, optional = true }

[dev-dependencies]
anyhow = { workspace = true }
Expand Down Expand Up @@ -70,14 +70,27 @@ native-tls = ["reqwest/native-tls"]
rustls = ["reqwest/rustls-tls-native-roots"]
sha1 = ["dep:sha1"]
sha2 = ["dep:sha2"]
tar-gz = [
"dep:flate2",
"dep:tar",
]
tar-xz = [
"dep:liblzma",
"dep:tar",
]
theseus = [
"dep:target-triple",
"github",
"sha2",
"tar-gz",
]
zip = [
"dep:zip",
]
zonky = [
"maven",
"liblzma"
"tar-xz",
"zip",
]

[package.metadata.docs.rs]
Expand Down
8 changes: 8 additions & 0 deletions postgresql_archive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ The following features are available:
| `theseus` | Enables theseus PostgreSQL binaries | Yes |
| `zonky` | Enables zonky PostgreSQL binaries | No |

### Extractors

| Name | Description | Default? |
|----------|----------------------|----------|
| `tar-gz` | Enables md5 hashers | Yes |
| `tar-xz` | Enables sha1 hashers | No |
| `zip` | Enables sha2 hashers | No |

### Hashers

| Name | Description | Default? |
Expand Down
8 changes: 6 additions & 2 deletions postgresql_archive/src/extractor/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
mod model;
pub mod registry;
#[cfg(feature = "tar-gz")]
mod tar_gz_extractor;
#[cfg(feature = "liblzma")]
#[cfg(feature = "tar-xz")]
mod tar_xz_extractor;
#[cfg(feature = "zip")]
mod zip_extractor;

pub use model::ExtractDirectories;
#[cfg(feature = "tar-gz")]
pub use tar_gz_extractor::extract as tar_gz_extract;
#[cfg(feature = "liblzma")]
#[cfg(feature = "tar-xz")]
pub use tar_xz_extractor::extract as tar_xz_extract;
#[cfg(feature = "zip")]
pub use zip_extractor::extract as zip_extract;
8 changes: 8 additions & 0 deletions postgresql_archive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@
//! | `theseus` | Enables theseus PostgreSQL binaries | Yes |
//! | `zonky` | Enables zonky PostgreSQL binaries | No |
//!
//! ### Extractors
//!
//! | Name | Description | Default? |
//! |----------|----------------------|----------|
//! | `tar-gz` | Enables md5 hashers | Yes |
//! | `tar-xz` | Enables sha1 hashers | No |
//! | `zip` | Enables sha2 hashers | No |
//!
//! ### Hashers
//!
//! | Name | Description | Default? |
Expand Down
3 changes: 3 additions & 0 deletions postgresql_extensions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,17 @@ blocking = ["tokio"]
portal-corp = [
"dep:target-triple",
"postgresql_archive/github",
"postgresql_archive/zip",
]
steampipe = [
"dep:serde_json",
"postgresql_archive/github",
"postgresql_archive/tar-gz",
]
tensor-chord = [
"dep:target-triple",
"postgresql_archive/github",
"postgresql_archive/zip",
]
tokio = [
"postgresql_commands/tokio",
Expand Down