So I'm working on this project that uses both MySql and PHP. For my own stuff, I like it all Open Source if I can get away with it, but philosophically and practically. Having recently created a MySql database, I wanted to make a classic Entity Relationship Diagram (ERD) from it. Given the project, I wanted to do this with all free software, Linux preferred. Which lead me to the inevitable conclusion that data modeling in Linux is craptastic.
Dia is not really the tool for the job, but I was willing to use, as it's one of the only things out there. I've used tools to diagram structures, but I find them slow compared to just hand coding. What I usually use the design tools for is to graph what I've already done by hand and maybe formalize it a little. Also, a missing key relationship will jump out at you in a picture where it can sometimes hide in code.
All diagram options I found seem to take an existing diagram and make SQL, which honestly doesn't suit my requirement. If it could go both ways, that would be fine, but everyone seemed to have a starting point that didn't match mine.
Just as I was about to give up on silly diagrams I happened upon Graphvis. And a truly brilliant perl project that hooks into it, SQL Fairy ( gotta love the logo.) It takes raw SQL scripts and translates them into all kinds of things, like SQL for other DB flavors and graphs, using graphvis. It will also theoretically spit out Dia files, using the DiaUml producer, but that has yet to work for me.
Once all the bits are installed, this does work:
sqlt-graph -f MySQL --show-constraints --show-datatypes -o tables.png -t png tables.sql
It's an amazing thing. You can't position the elements in the picture yourself, but it does all the work and pretty good job of balancing the nodes. I may even implement a database explorer with graphvis for work. Could be fun, there's a web based thingy for it, but I'd want to write my own.
Dia is not really the tool for the job, but I was willing to use, as it's one of the only things out there. I've used tools to diagram structures, but I find them slow compared to just hand coding. What I usually use the design tools for is to graph what I've already done by hand and maybe formalize it a little. Also, a missing key relationship will jump out at you in a picture where it can sometimes hide in code.
All diagram options I found seem to take an existing diagram and make SQL, which honestly doesn't suit my requirement. If it could go both ways, that would be fine, but everyone seemed to have a starting point that didn't match mine.
Just as I was about to give up on silly diagrams I happened upon Graphvis. And a truly brilliant perl project that hooks into it, SQL Fairy ( gotta love the logo.) It takes raw SQL scripts and translates them into all kinds of things, like SQL for other DB flavors and graphs, using graphvis. It will also theoretically spit out Dia files, using the DiaUml producer, but that has yet to work for me.
Once all the bits are installed, this does work:
sqlt-graph -f MySQL --show-constraints --show-datatypes -o tables.png -t png tables.sql
It's an amazing thing. You can't position the elements in the picture yourself, but it does all the work and pretty good job of balancing the nodes. I may even implement a database explorer with graphvis for work. Could be fun, there's a web based thingy for it, but I'd want to write my own.
From:
no subject
From:
no subject