DBDesign Experiment

About
Download (sourceforge)
Projects

CHM help files
DBDesigner
MTG Search
musikCube 2

 
Database Design Experiment
SourceForge.net Logo The Database Design Experiment is an attempt to visualize databases that follow a simple naming convention. It requires MySQL, PHP and Flashplayer 7.



Content

  • Small FAQ
  • The naming convention
  • Check it out
  • Download
  • Installing

Small FAQ

Why Flash 7?
Beacuse I wanted to learn the new features in Actionscript 2.0 (Contextmenus, REAL Classes, Assigning of datatypes, etc)

How is the databasedesign saved?
If you hit the Save-button the PHP-scripts will try to create a table in the current database called dbdesign_variables where the design is saved.

xxxxxx does not work?
This is just an experiment and not a full featuring project. Try to fix it yourself :)

How about xxxxxxx
Please do :)

The naming convention

The naming convention is fairly simple but I find it very usefull myself. It checks if the fields are named like the following:
*<tablename>_<fieldname>
Lets consider the following tables:
users
id
name
username
primary_groups_id
groups
id
groupname
creator_users_id

In this case the DBDesigner guesses that there are one relation from the users.primary_groups_id to groups.id and one from groups.creator_users_id to users.id.
Pretty simple so far, but this is not the whole truth. The PHP-script actualy constructs a Regular expression for each field to check all other fields against. The regexp for users.id will look like this:
(^|[^a-z])users?_id
As you can see the character before the table-name must either be beginning of string or a none character witch meens that for instance creatorusers_id wouldent match. Also when the table-name ends with a "s" (plural) this will be optional in the field-name to match.
Some examples:
Field to match Field to match it with Match
users.id groups.owner_users_id Yes
users.id groups.owneruser_id No
users.id groups.owner_user_id Yes
users.id groups.user_id Yes

Check it out


Downloading

Download at sourceforge

Installation

  • Download and unpack in a directory that is accessable throught the webserver.
  • Open the include/global.php-file and change:
    $sDBHost            = "localhost";
    $sDBLogin           = "root";
    $sDBPassword        = "";
    
  • Try it!