This database schema viewer was written mainly for myself to be able to
visualise a database schema without the need to use installed programs or
custom viewers, so I have written this for web based viewing and to be able
to accept SQL scripts for creating tables directly. You can simply copy and
paste you SQL scripts into the text area below and hit esc to display it.
You can move the tables around using the mouse and the SQL scripts are
updated with comments to describe the new location which can be re-read by
this viewer. The idea is that you can then copy the SQL back to a text
editor and save it.
- Copy into or update the SQL script
- Hit 'ESC' to update the display
- Fields that are part of primary keys are displayed with an *
- Not null fields are displayed in bold
- When you move the tables, the script is automatically updated
- Copy and paste the script back into a file to save
There are probably errors that I havent found yet related to different
peoples formats for writting sql statements. I also have not tested if the
line based comments added with a prefix of two hyphens(--) are allowed in
all database servers or tested if it runs in all browsers. Please feel free
to report any issues back to me.
|
|
\n');
displayFrame.document.write(' \n');
displayFrame.document.write(' \n');
displayFrame.document.write('\n');
for( var i=0; i < tables.length; i++ ) {
displayFrame.document.write('
\n');
displayFrame.document.write('
\n');
displayFrame.document.write('
\n');
for( var j=0; j < fields.length; j++ ) {
if( fields[j][0] == tables[i][0] ) {
displayFrame.document.write(' | ' + fields[j][3] + (fields[j][4] ? '' : '') + fields[j][1] + (fields[j][3] ? '' : '') + ' | ' + fields[j][2] + ' |
\n');
}
}
displayFrame.document.write('
\n');
displayFrame.document.write('
\n');
}
// competition
displayFrame.document.write(' \n');
displayFrame.document.write('