-
Notifications
You must be signed in to change notification settings - Fork 0
Added more description and included example graph and query and updat… #23
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
base: main
Are you sure you want to change the base?
Conversation
README.md
Outdated
The PartiQL Graphviz visualization tool allows you to easily convert PartiQL queries into visual graph representations. | ||
To use this functionality, first create an instance of the AstToGraph class. You can then convert a PartiQL query string directly to a graph using convertQueryToGraph(String query), | ||
or if you already have a parsed AST statement, use convertAstToGraph(Statement statement). Once you have the graph, you can export it in various formats: save it as a DOT file with convertGraphToDot(graph, filePath), | ||
render it as a PNG image using convertDotToPng(graph, filePath, scale), or create an SVG with convertDotToSvg(graph, filePath, scale). The scale parameter allows you to adjust the size of the output image. | ||
This visualization capability is particularly useful for understanding complex query structures, debugging query issues, or educational purposes to demonstrate how PartiQL parses different query constructs. | ||
The generated visual representation clearly shows the hierarchical structure of the query, including SELECT clauses, FROM sources, WHERE conditions, and other query components with their relationships. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all helpful info. Thanks for adding it! Looking at the rendered README file, it all shows up as one paragraph. Can you add some line breaks between the different sections? Also for code references, let's wrap the code in backticks -- https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code.
README.md
Outdated
PartiQLParser parser = PartiQLParser.standard(); | ||
PartiQLParser.Result parseResult = parser.parse(query); | ||
Statement statement = parseResult.statements.get(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's revert this added spacing. it doesn't align with the above comment
README.md
Outdated
|
||
### Example Graph | ||
|
||
<img alt="img_1.png = 70x70" height="400" src="img_1.png" width="500"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image doesn't show up. You might need to include it as an asset. A couple references:
README.md
Outdated
|
||
TODO: | ||
- Implement remaining AST nodes that are currently not handled by the visualization system | ||
- Extend AST visualization to PartiQL plan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: slightly incorrect. the AST visualization would be its own thing from the Plan visualization
- Extend AST visualization to PartiQL plan | |
- Visualization of the PartiQL plan |
…DO and example code to suggesteed changes
README.md
Outdated
``` | ||
|
||
### Example Graph | ||
 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still doesn't quite work since you need to include the image in the repository.
See https://github.com/partiql/partiql-graphviz-java/blob/Readmeupdated/README.md
…ed example code
Issue #, if available:
none
Description of changes:
Added example graph and query
Updated example code
Added more description for user to call graphviz visualization functions
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.