Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Rajiv Ranganath <[email protected]>
  • Loading branch information
rajivr committed Nov 8, 2023
1 parent 8cb7965 commit 2e527b8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
11 changes: 9 additions & 2 deletions extension/partiql-extension-visualize/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
dot-writer = { version = "0.1.*", optional = true }
itertools = { version = "0.10.*", optional = true }

[features]
default = []
visualize-dot = [
"dep:dot-writer",
"dep:itertools",
]
1 change: 1 addition & 0 deletions extension/partiql-extension-visualize/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ pub trait ToDotGraph<T> {
fn to_graph(self, data: &T) -> String;
}

#[cfg(feature = "visualize-dot")]
pub(crate) const FG_COLOR: &'static str = "\"#839496\"";
9 changes: 8 additions & 1 deletion extension/partiql-extension-visualize/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 2e527b8

Please sign in to comment.