Techmania

June 9, 2008

Creating ER diagrams from SQL

Filed under: Uncategorized — mifan @ 10:34 am

SQLt/SQL::Translator/SQLFairy is a great tool to create ER diagrams from SQL:

SQL::Translator is a group of Perl modules that manipulate structured data definitions (mostly database schemas) in interesting ways, such as converting among different dialects of CREATE syntax (e.g., MySQL-to-Oracle), visualizations of schemas (pseudo-ER diagrams: GraphViz or GD), automatic code generation (using Class::DBI), converting non-RDBMS files to SQL schemas (xSV text files, Excel spreadsheets), serializing parsed schemas (via Storable, YAML and XML), creating documentation (HTML and POD), and more.

In Ubuntu Linux and Debian Linux, this can be obtained by installing SQLFairy:
apt-get install sqlfairy
This is quite useful if you follow a bottom-up approach: create the SQL first, and then create ER diagrams – although this might not be a common development method, it does have its uses, and some of us like it 🙂
So for instance, say you have a MySQL schema named sample.sql. To create a ER diagram with color, named sample_schema.png, run the following in the command line:
sqlt-diagram -d=MySQL -o=sample_schema.png sample.sql --color
where -d=MySQL specified the MySQL driver. Other available drivers can be obtained by:
sqlt -l
Additionally, sqlt can also be used to convert between various database schemas as well.

SQLFairy ER Diagram

Advertisements

29 Comments »

  1. […] while searching for another application to do just what I want (and not cost me a cent) I found a post about something that will be extremely […]

    Pingback by ER Diagrams from SQL files | Christian Biggins — November 21, 2008 @ 2:03 am | Reply

  2. any news coming ?

    Comment by twefiace — May 23, 2009 @ 4:22 am | Reply

  3. good one…… btw, any utility to generate sql script from a e-r diagram (like visio in win32) ?

    Comment by chatura — June 16, 2009 @ 9:24 am | Reply

  4. Works great, as long as you don’t have more than five tables in your database. Anything bigger than that and you get a big mess of lines that go all over the place. Biggest drawback is lack of crow’s feet notation which for me is a must with such diagrams

    Comment by zagor — August 25, 2009 @ 3:19 am | Reply

  5. its very good

    Comment by al3boshi — October 6, 2009 @ 9:28 am | Reply

  6. It really very good,

    Thanks for the tool.

    Comment by somanath — February 22, 2010 @ 9:19 am | Reply

  7. Thanks a lot,you really saved me.

    Comment by Shafaet Ashraf — January 10, 2012 @ 11:07 pm | Reply

  8. good tools

    Comment by saleh alkhaier — April 15, 2012 @ 1:28 pm | Reply

  9. onlinecasinos112.dk…

    Web | Christian Biggins…

    Trackback by onlinecasinos112.dk — March 21, 2013 @ 3:48 am | Reply

  10. […] Źródło: techmania.wordpress.com […]

    Pingback by Ubuntu - pomoc | Tworzenie diagramu ER z kodu SQL — March 24, 2013 @ 5:46 pm | Reply

  11. 28. Februar 2013 um 21:40…

    Development | Christian Biggins…

    Trackback by 28. Februar 2013 um 21:40 — March 25, 2013 @ 10:03 am | Reply

  12. mouse click the up coming post…

    Development | Christian Biggins…

    Trackback by mouse click the up coming post — March 30, 2013 @ 3:09 pm | Reply

  13. billig lån…

    Development | Christian Biggins…

    Trackback by billig lån — April 12, 2013 @ 12:47 am | Reply

  14. Vind ipad…

    Development | Christian Biggins…

    Trackback by Vind ipad — April 13, 2013 @ 1:39 pm | Reply

  15. please click the next website…

    Development | Christian Biggins…

    Trackback by please click the next website — April 18, 2013 @ 5:08 am | Reply

  16. I like perusing your site. Appreciate it!

    Comment by http://youtube.com/ — March 19, 2014 @ 7:25 am | Reply

  17. The colour of the banner may also be determined by the niche which is why it is produced.

    Click the Save Changes button and view your
    account to determine your image. Every business should have a target audience.

    Comment by http://imx.tw/flashbanners60400 — March 31, 2014 @ 12:54 pm | Reply

  18. If some one wants to be updated with latest technologies then he must be pay
    a visit this web site and be up to date everyday.

    Comment by Mozelle — April 22, 2014 @ 8:58 pm | Reply

  19. You ought to take part in a contest for one of the best websites on the internet.
    I’m going to highly recommend this website!

    Comment by Luigi — April 22, 2014 @ 9:09 pm | Reply

  20. scott tucker

    Technology | Christian Biggins

    Trackback by scott tucker — July 8, 2014 @ 5:30 am | Reply

  21. 24 hour water removal restoration Carlsbad

    My Opinions | Christian Biggins

    Trackback by 24 hour water removal restoration Carlsbad — July 12, 2014 @ 6:52 am | Reply

  22. theprimetimecruise.com

    Technology | Christian Biggins

    Trackback by theprimetimecruise.com — August 13, 2014 @ 7:46 am | Reply

  23. […] অনলাইন Latex এডিটর অনলাইন সিনট্যাক্স হাইলাইটার(Plain text to html) Generate Schema diagram from sql […]

    Pingback by দরকারি সব লিঙ্ক এবং ই-বুক… | Saad's World — August 19, 2014 @ 8:27 am | Reply

  24. social anxiety disorder causes

    Technology | Christian Biggins

    Trackback by social anxiety disorder causes — August 26, 2014 @ 6:40 pm | Reply

  25. nabisco saltine cracker coupons

    Technology | Christian Biggins

    Trackback by nabisco saltine cracker coupons — August 27, 2014 @ 8:54 am | Reply

  26. Printable Keurig Coupons Canada

    Technology | Christian Biggins

    Trackback by Printable Keurig Coupons Canada — August 27, 2014 @ 10:27 am | Reply

  27. Appreciation to my father who informed me regarding this web site, this weblog is in fact remarkable.

    Comment by global business database — September 18, 2014 @ 4:42 am | Reply

  28. […] অনলাইন সিনট্যাক্স হাইলাইটার(Plain text to html) Generate Schema diagram from sql Special Thanks To শাফায়েত ভাই […]

    Pingback by প্রোগ্রামিং এর ইবুক লিংক - All Download — January 17, 2015 @ 7:45 am | Reply

  29. Do you mind if I quote a few of your posts as long as
    I provide credit and sources back to your weblog? My blog is in the very same niche
    as yours and my users would definitely benefit from a lot of the information you provide here.
    Please let me know if this okay with you. Appreciate it!

    Comment by Cecelia — July 22, 2016 @ 8:36 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: