mysqlviz - MySQL and SQLite Database Visualisation Tool - Google Project Hosting

mysqlviz - MySQL and SQLite Database Visualisation Tool - Google Project Hosting

Render a graphical representation of a MySQL or SQLite database from a mysqldump or sqlite3 .dump file.

News

  • Now with sqlite support!

Features

  • Can infer foreign key relationships if you do not have them defined
  • Handles partial dumps (FK to tables that are not defined within the dump)
  • Fast! Uses sed and grep for data extraction (MySQL only)

Example

 


Click the image to view the mysqldump file from which it was generated.

Download

mysqlviz

Usage

[mysqlviz - mysql + sqlite database visualisation tool]

usage:
  ./mysqlviz -f <sqldumpfile> [-r]
                                 ^--- 'redump' mode: generates a
                                      mysqldump command line to redump.
toolchain:
 $ mysqldump -d db >db.sql          # MySQL: -d = 'no data', only structure
    - OR -
 $ sqlite database.db .dump >db.sql # SQLite (also: 'sqlite3 ...')
 $ ./mysqlviz -f ./db.sql >./db.dot # 'dot' is a graphviz format.
 $ dot -Tpng db.dot >db.png         # generate image with graphviz

notes:
 if you do not have any foreign keys defined, relationships will be
 assumed in cases where a column name ends in one of (id/ID/_id/_ID) and
 there is a matching table (for example, onetable.othertable_ID column, and
 othertable is defined).  the program will also match tables with
 various prefixes and suffixes.

Dependencies

Written in PHP. Uses sed and grep for speed, and graphviz as the graph renderer. Tested with output from MySQL 5.0 and SQLite 3.7.2

Wishlist

  • Cutesy diamonds etc. to denote relationship types
  • Testing against dumps from older/newer MySQL versions
  • Options for modifying the complexity of output (column types, relationship type, etc.)

你可能感兴趣的:(database)