diff --git a/extension/partiql-extension-visualize/Cargo.toml b/extension/partiql-extension-visualize/Cargo.toml index 8acc120c..5e755af0 100644 --- a/extension/partiql-extension-visualize/Cargo.toml +++ b/extension/partiql-extension-visualize/Cargo.toml @@ -24,5 +24,12 @@ bench = false partiql-ast = { path = "../../partiql-ast", version = "0.6.*" } partiql-logical = { path = "../../partiql-logical", version = "0.6.*" } -dot-writer = "0.1.*" -itertools = "0.10.*" \ No newline at end of file +dot-writer = { version = "0.1.*", optional = true } +itertools = { version = "0.10.*", optional = true } + +[features] +default = [] +visualize-dot = [ + "dep:dot-writer", + "dep:itertools", +] diff --git a/extension/partiql-extension-visualize/src/common.rs b/extension/partiql-extension-visualize/src/common.rs index 1eb41aba..1a79bc27 100644 --- a/extension/partiql-extension-visualize/src/common.rs +++ b/extension/partiql-extension-visualize/src/common.rs @@ -2,4 +2,5 @@ pub trait ToDotGraph { fn to_graph(self, data: &T) -> String; } +#[cfg(feature = "visualize-dot")] pub(crate) const FG_COLOR: &'static str = "\"#839496\""; diff --git a/extension/partiql-extension-visualize/src/lib.rs b/extension/partiql-extension-visualize/src/lib.rs index 7ecc7654..d22e7d51 100644 --- a/extension/partiql-extension-visualize/src/lib.rs +++ b/extension/partiql-extension-visualize/src/lib.rs @@ -1,8 +1,15 @@ +#[cfg(feature = "visualize-dot")] mod ast_to_dot; + +#[cfg(feature = "visualize-dot")] mod plan_to_dot; pub(crate) mod common; +#[cfg(feature = "visualize-dot")] pub use ast_to_dot::AstToDot; -pub use common::ToDotGraph; + +#[cfg(feature = "visualize-dot")] pub use plan_to_dot::PlanToDot; + +pub use common::ToDotGraph;