[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: database -- Physical Model
From: |
Antenore Gatta |
Subject: |
Re: database -- Physical Model |
Date: |
Thu, 22 May 2008 09:22:57 +0200 |
On Wed, May 21, 2008 at 10:48 PM, Davi Leal <address@hidden> wrote:
> Just a little of feedback,
>
You are welcome :-)
>
> The capitalization used at SQL Implementation [1] of the database is lost when
> the database is created in PostgreSQL.
>
> [1] http://gnuherds.org/doc/GNUHerds__SQL_Implementation.sql
>
>
> So I have googled a little up to get a convertion tool directly from the "SQL"
> to "dot" [2].
>
> [2] http://www.cisl.ucar.edu/nets/tools/NND/db/schema/render.html
>
> [3] http://tapoueh.free.fr/softs/src/sql2dot.py
> Ref. from: http://tapoueh.free.fr/softs/tools.html
>
>
> From the SQL Implementation [1], I have removed all the comments, INSERTs,
> etc. up to get the attached gnuherds.sql file.
>
>
> Following the procedure exposed at [2] we get a PNG image with capitalized
> strings. However the final PNG is not so cool as the one you are getting
> Antenore! I do not know why.
>
I used postgresql_autodoc (http://www.rbt.ca/autodoc/index.html) that
is a Perl script that connect directly to postgresql and generate
different phisical models.
The graphviz format can use html to format the output, so my .dot file
is generated in this way:
"e2_entityfreesoftwareexperiences" [shape = plaintext, label = <
<TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0"> <TR ><TD
PORT="ltcol0"> </TD> <TD bgcolor="grey90" border="1" COLSPAN="4"> \N
</TD> <TD PORT="rtcol0"></TD></TR> <TR><TD PORT="ltcol1" ></TD><TD
align="left" > e2_id </TD><TD align="left" > serial </TD><TD
align="left" > PK </TD><TD align="left" > </TD><TD align="left"
PORT="rtcol1"> </TD></TR> <TR><TD PORT="ltcol2" ></TD><TD align="left"
> e2_e1_id </TD><TD align="left" > integer </TD><TD align="left" >
</TD><TD align="left" > FK </TD><TD align="left" PORT="rtcol2">
</TD></TR> <TR><TD PORT="ltcol3" ></TD><TD align="left" > e2_project
</TD><TD align="left" > character varying(30) </TD><TD align="left" >
</TD><TD align="left" > </TD><TD align="left" PORT="rtcol3">
</TD></TR> <TR><TD PORT="ltcol4" ></TD><TD align="left" >
e2_description </TD><TD align="left" > character varying(60) </TD><TD
align="left" > </TD><TD align="left" > </TD><TD align="left"
PORT="rtcol4"> </TD></TR> <TR><TD PORT="ltcol5" ></TD><TD align="left"
> e2_uri </TD><TD align="left" > character varying(255) </TD><TD
align="left" > </TD><TD align="left" > </TD><TD align="left"
PORT="rtcol5"> </TD></TR> </TABLE>> ];
sql2dot.py generate the same using a "record" format as below:
"E2_EntityFreeSoftwareExperiences" [
label = "E2_EntityFreeSoftwareExperiences|<E2_Id> E2_Id|<E2_E1_Id>
E2_E1_Id|<E2_Project> E2_Project|<E2_Description>
E2_Description|<E2_URI> E2_URI"
shape = "record"
];
> At the worst case we could improve such sql2dot.py Python script...
>
I'll try.