legrandlegrand / revj2 Goto Github PK
View Code? Open in Web Editor NEWfork from reverse snowflake joins (https://sourceforge.net/projects/revj/)
fork from reverse snowflake joins (https://sourceforge.net/projects/revj/)
Installation ============ Install Graphviz (tested with ver 2.38 and 2.43) Install Python (tested with ver 3.8 and 3.9) Self-tests ========== python revj.py Note that some tests may fail in order to document bugs/future work. They are documented as "known bug" Running on Unix =============== gvpr minds about the line endings in the dir.g file. GUI === There is a very simple interface that displays a welcome message if everything was installed correctly. If not, check that Graphviz is installed, ex: dot is in the PATH, and if there is pyparsing.py in PYTHONPATH. Paste the SQL in the upper text entry, select the diagram generation algorith (or leave the default "fdp"), and press "Generate diagram". If edges are cluttered, increase the "distance" parameter. In case there are any problems due to the dir.g script, please use the "one-pass" algorithm, or use the command line. The generated diagram is in the file "current.gif". You can also edit "current.dot" and run "dot" on top of it To run the tool: python gui.py Bugs and Limitations ==================== Please qualify columns with aliases. Instead of "select a from table" use "select t.a from table t". This is trivial to fix for one table, however in general it does require access to the database. Instead of "Select name, id, dep_name from person inner join department..." use ""Select p.name, p.id, d.dep_name from person p inner join department d .." Generating a diagram from standard input ======================================== Command line parameter '-' will cause text to be read from standard input. Iy you paste directly text, end input with ^D (^Z on Windows) python revj.py - Generating a diagram from file ============================== Specify filename on commandline: python revj.py sample.sql | dot -Grankdir=LR -Edir=none -T png -o current.png Getting nicer output from Graphviz ================================== Emden R. Gansner suggested to generate a graph, parse it and generate a new, directed graph which looks much better python revj.py - | fdp | gvpr -fdir.g | dot -Grankdir=LR -Edir=none -T png -o current.png You might want to try several layout algorithms, since the graph layout varies wildly. Usually neato and fdp looks the best and are reliable. python revj.py vesel.sql | neato | ..... python revj.py vesel.sql | circo | ... python revj.py vesel.sql | dot | ... python revj.py vesel.sql | fdp | ... python revj.py vesel.sql | twopi | ... Credits: ======== Emden R. Gansner and his colleagues at AT&T Research Paul McGuire for developing PyParsing and code reviews Pascal Lemoy for submitting lots of SQL fragments with bugs
Hi legrandlegrand
Love that you have made the updates to this gem. I do though have some issues installing it and getting it to work in my Anaconda Environments. Maybe it's just because I am a novice but I don't understand how to install or run the script since it is in .py format. Any help, would love a more detailed install description.
Best Regards
Esben
Hi, I think this could be a bug, maybe someone can confirm or help ?
I always get this Error message if I try to generate a diagram (I use IDLE shell 3.9.4)
Thanks for your support
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.