Thread: Database Designer report at 28/07/2001

Database Designer report at 28/07/2001

From
Luis Ochoa
Date:
Hi, I don't report to this list (just to gsoc one) from some time, mostly because I don't want to spam it.

But, right now I want to share the status at the database modeler as today. As you can notice (and test at pgAdmin repository) right now you are able to create and save / load a single model in the database designer. A lot of bugs have been fixed, and we have now a more stable designer but still is a work in progress that will change in some time.

This week and last two I have been working on multiple views for same model feature:

This feature will bring some improvements over old one model approach for the designer, a slides presentation with this feature can be shown online at google docs:

http://goo.gl/XT2Az

Right now I still continue working on the feature and so far I have implemented a new approach for my hotdraw library that allow me to show in different views the same object, in a first step this was done for normal graphical objects like squares circles and so far, later it was done for polygon figures (harder case because each view can have different number of segments and other things).  Later all database designer figures were adapted to this new approach, and
right now I'm working in a way of reusing created objects inside the main model in all diagrams (a treeview with that info).

I hope to finish this feature by weekend or middle of next week, it depends of bug fixing because it have been a very deeply change in the library, that don't allow in their native architecture to show same figure in different views at same time.

At the presentation is included a screenshot at the end with the proposal UI.

Well, any ideas, suggestions or commentaries are welcome.

Regards, Luis.

Re: Database Designer report at 28/07/2001

From
Dave Page
Date:
Hi Luis

On Fri, Jul 29, 2011 at 2:59 AM, Luis Ochoa <ziul1979@gmail.com> wrote:
> Hi, I don't report to this list (just to gsoc one) from some time, mostly
> because I don't want to spam it.

You should do - there's less chance of us rejecting changes if you
keep us up to date :-)

> But, right now I want to share the status at the database modeler as today.
> As you can notice (and test at pgAdmin repository) right now you are able to
> create and save / load a single model in the database designer. A lot of
> bugs have been fixed, and we have now a more stable designer but still is a
> work in progress that will change in some time.

I just gave it a whirl for the first time (using the code committed to
master, so some of these may be fixed), and immediately ran into a few
issues:

- Generating a short table name from a long one caused an assertion.
See the attached screenshot (what's the point of that feature anyway?)

- The table model is so small it's unreadable.

- Another assertion, when trying to add a column.

- The generated SQL lacks quoting of identifiers.

- The generated SQL isn't syntax highlighted.

- We'll also need to work on the icons - I'll probably be able to help
with that.

The other issue I ran into is one of design - when adding a new
column, we should ask for all the properties of the column on a
dialogue at once (can you reuse dlgColumn, or at least
dlgColumn.xrc?). Specifying just the name, and then having to go and
manually adjust the rest of the properties is really quite tedious and
not a good UI design.

> This week and last two I have been working on multiple views for same model
> feature:
>
> This feature will bring some improvements over old one model approach for
> the designer, a slides presentation with this feature can be shown online at
> google docs:
>
> http://goo.gl/XT2Az

Looks interesting... of more interest to me though is reverse
engineering of an existing schema. Is that on your roadmap?

> Right now I still continue working on the feature and so far I have
> implemented a new approach for my hotdraw library that allow me to show in
> different views the same object, in a first step this was done for normal
> graphical objects like squares circles and so far, later it was done for
> polygon figures (harder case because each view can have different number of
> segments and other things).  Later all database designer figures were
> adapted to this new approach, and
> right now I'm working in a way of reusing created objects inside the main
> model in all diagrams (a treeview with that info).

OK. Does that include the renaming we discussed?

> I hope to finish this feature by weekend or middle of next week, it depends
> of bug fixing because it have been a very deeply change in the library, that
> don't allow in their native architecture to show same figure in different
> views at same time.

OK.

> At the presentation is included a screenshot at the end with the proposal
> UI.

s/A probably solution/A probable solution


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

Re: Database Designer report at 28/07/2001

From
"Dickson S. Guedes"
Date:
2011/7/29 Dave Page <dpage@pgadmin.org>:
> I just gave it a whirl for the first time (using the code committed to
> master, so some of these may be fixed), and immediately ran into a few
> issues:

I tested here  (from commit b63c368a84) and have some opinions about
this cool addition to pgAdmin3:

- The icons for "Add an empty table" and "Add a new column to selected
table" are the same, they could be different.

- The "Short Table Name" length is fixed in 3 characters. That could
be customisable.

- When adding a foreign key to a table, if the referenced column type
is 'serial' the reference column should be 'integer', but it stay
'serial' and isn't possible change because the item for this in the
context menu is disabled. So, in this case, it could automatically
create an 'integer' reference column in child table when it references
a 'serial' column in parent and the equivalent for 'bigserial'.

- I have some DOMAINs and TYPEs but they aren't listed when choosing
the field type via context menu. This list could be dynamic or there
could be a text box to type a custom type.

- When I close the DbDesigner window after a change it doesn't ask for
confirmation and when I reopen it the diagram was lost. It could ask
for closing, or clear the diagram only when the 'New model' menu item
(or button) was clicked.

- When open a model, it could ask for saving the previous model if it
has changes.

- The generated SQL table's definition isn't in dependency order when
adding a new parent table to diagram, but the generated script could
be ordered by foreign key dependencies.

- The visual relation line of self referencing tables isn't displayed,
and the reference field couldn't be edited or removed, maybe
displaying the relation line would be enough.

- Compress the generated 'pgd' file using wxZlibInputStream and
wxZlibOutnputStream.

Thanks Luis for this work!

Best regards
--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://github.net/guedes - http://www.postgresql.org.br

Re: Database Designer report at 28/07/2001

From
Luis Ochoa
Date:
On Fri, Jul 29, 2011 at 4:34 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi Luis

On Fri, Jul 29, 2011 at 2:59 AM, Luis Ochoa <ziul1979@gmail.com> wrote:
> Hi, I don't report to this list (just to gsoc one) from some time, mostly
> because I don't want to spam it.

You should do - there's less chance of us rejecting changes if you
keep us up to date :-)

Ok, I'm going to send any important update to this list for community review and suggestions.
 
> But, right now I want to share the status at the database modeler as today.
> As you can notice (and test at pgAdmin repository) right now you are able to
> create and save / load a single model in the database designer. A lot of
> bugs have been fixed, and we have now a more stable designer but still is a
> work in progress that will change in some time.

I just gave it a whirl for the first time (using the code committed to
master, so some of these may be fixed), and immediately ran into a few
issues:

- Generating a short table name from a long one caused an assertion.
See the attached screenshot (what's the point of that feature anyway?)

Short Name is a feature used by auto-naming foreign keys subsystem, isn't mandatory to use it, but if you want more readable names generate in an automatically way for foreign key constraints is good idea to use it. This feature is on testing now, if people like it this feature stays if not it should be suppressed.
 
- The table model is so small it's unreadable.

Table figure is generated using as basis the font size, if user change default font size for the modeler tables automagically change it.  I'll add at next patch a menu item to allow changing the default font and size of modeler.
 
- Another assertion, when trying to add a column.

I'll check it, this is because all menus at figures are generated automatically from a list of strings inside the figure and theirs event ids are automatically assigned and as I can see in the screenshot I probably use at some point 0 as the base and then this id was used for first item. Mostly because I don't test it on a mac ;)    I'll fix it for next patch.
 
- The generated SQL lacks quoting of identifiers.

SQL generation subsystem will change for next patch, because I want to generate tables first and later add constraints to avoid dependencies and when I do that I'm going to add this suggestion.  Just to clarify when you said quoting of indentifiers we are talking about quoting tables names and columns names?


- The generated SQL isn't syntax highlighted.

Well, right now this wasn't on my schedule but I'll try to do that at last week of proposal dedicated to bug hunting and improvement of UI if time is enough.
 
- We'll also need to work on the icons - I'll probably be able to help
with that.

Yes, right now any help with icons will be great because sometimes icons are just a stub or borrow from another feature.
 
The other issue I ran into is one of design - when adding a new
column, we should ask for all the properties of the column on a
dialogue at once (can you reuse dlgColumn, or at least
dlgColumn.xrc?). Specifying just the name, and then having to go and
manually adjust the rest of the properties is really quite tedious and
not a good UI design.


Yes, that is an interesting and needed feature that I have been thinking about (almost from begining), but is a little complex (because way columns are stored inside the graphical model) to do it right now for next patch, I'll try to do it at the UI improvement week at the end of schedule or later but outside gsoc.

 
> This week and last two I have been working on multiple views for same model
> feature:
>
> This feature will bring some improvements over old one model approach for
> the designer, a slides presentation with this feature can be shown online at
> google docs:
>
> http://goo.gl/XT2Az

Looks interesting... of more interest to me though is reverse
engineering of an existing schema. Is that on your roadmap?

Well, in the proposal I have some kind of reverse engineering of tables features on my schedule, called table sync because this feature will allow to add tables from a schema to the model and then generate a alter table instead of a create table for this imported table. But only if model is generated to be created at same schema, in other way it generates a create table.

This feature allow to choose several tables from same scheme at same time and in this way import relationships between selected tables too. But right now I haven't any design for it (at the middle of this week after next patch I'll start to work on it), and I have not a real idea about how this feature will really work.

> Right now I still continue working on the feature and so far I have
> implemented a new approach for my hotdraw library that allow me to show in
> different views the same object, in a first step this was done for normal
> graphical objects like squares circles and so far, later it was done for
> polygon figures (harder case because each view can have different number of
> segments and other things).  Later all database designer figures were
> adapted to this new approach, and
> right now I'm working in a way of reusing created objects inside the main
> model in all diagrams (a treeview with that info).

OK. Does that include the renaming we discussed?

Yes next patch will rename wxhotdraw to hotdraw, and prefix wxhd to hd.

> I hope to finish this feature by weekend or middle of next week, it depends
> of bug fixing because it have been a very deeply change in the library, that
> don't allow in their native architecture to show same figure in different
> views at same time.

OK.

> At the presentation is included a screenshot at the end with the proposal
> UI.

s/A probably solution/A probable solution

:$ sometimes I'm tired and my english that is bad, becomes worst :(

Thanks for your comments Dave

Regards, Luis.

Re: Database Designer report at 28/07/2001

From
Luis Ochoa
Date:
On Fri, Jul 29, 2011 at 8:50 PM, Dickson S. Guedes <listas@guedesoft.net> wrote:
2011/7/29 Dave Page <dpage@pgadmin.org>:
> I just gave it a whirl for the first time (using the code committed to
> master, so some of these may be fixed), and immediately ran into a few
> issues:

I tested here  (from commit b63c368a84) and have some opinions about
this cool addition to pgAdmin3:

- The icons for "Add an empty table" and "Add a new column to selected
table" are the same, they could be different.

Yes Icons are just for testing right now it should be improved.
 
- The "Short Table Name" length is fixed in 3 characters. That could
be customisable.

It can be, but main idea is to create the smallest possible name to create constraints easy to read, I'll think about it for last week of my project when I'll check UI of the modeler.
 
- When adding a foreign key to a table, if the referenced column type
is 'serial' the reference column should be 'integer', but it stay
'serial' and isn't possible change because the item for this in the
context menu is disabled. So, in this case, it could automatically
create an 'integer' reference column in child table when it references
a 'serial' column in parent and the equivalent for 'bigserial'.

Ok, my mistake with automatically generation of foreign keys, I'll fix it for next patch, but you are able to create a foreign key for an existing column, if you table have columns before you add the fk, you are able to choose datatype of fk destination column and is on behalf of the user check the integrity of it.
 
- I have some DOMAINs and TYPEs but they aren't listed when choosing
the field type via context menu. This list could be dynamic or there
could be a text box to type a custom type.

Yes, this should be improved but because the way this works it would take some time and now my schedule is tight, then I'll try to add it after gsoc because that is a very important feature but will need a some major changes  (and time) at columns/tables
 
- When I close the DbDesigner window after a change it doesn't ask for
confirmation and when I reopen it the diagram was lost. It could ask
for closing, or clear the diagram only when the 'New model' menu item
(or button) was clicked.
- When open a model, it could ask for saving the previous model if it
has changes.

Yes it need to be added to the modeler, is just I have a lot of things at my head right (while working with new features and trying to accomplish it) now that I didn't notice simple things like that, I'll fix it for next patch.
 
- The generated SQL table's definition isn't in dependency order when
adding a new parent table to diagram, but the generated script could
be ordered by foreign key dependencies.

This will change for next patch, because dependecies are too difficult to acomplish always, and I'll generate first the table and then after generate all tables add the constraints to each one.
 
- The visual relation line of self referencing tables isn't displayed,
and the reference field couldn't be edited or removed, maybe
displaying the relation line would be enough.

This is not possible right now, becasue modeler needs a major change: a new kind of lines between figures known as orthogonal lines, and some adjust at the modeler and this change wasn't include at my schedule and I tried to do it but some complications didn't allow me to do it, in future after gsoc I'll do that :)

 
- Compress the generated 'pgd' file using wxZlibInputStream and
wxZlibOutnputStream.

Yes this is a good suggesting and in fact I read something about compression with libxml2 that automatically uses Zlib, but I didn't activate it and tested I'll do this for the last patch.
 
Thanks Luis for this work!

Best regards
--

Thanks for your suggestions Dickson,
Regards, Luis.

Re: Database Designer report at 28/07/2001

From
Dave Page
Date:
On Sun, Jul 31, 2011 at 2:59 AM, Luis Ochoa <ziul1979@gmail.com> wrote:
>
>> - The table model is so small it's unreadable.
>
> Table figure is generated using as basis the font size, if user change
> default font size for the modeler tables automagically change it.  I'll add
> at next patch a menu item to allow changing the default font and size of
> modeler.

It needs to work out of the box, not when the user adjusts the size
manually. Where is the default set? I can test on Mac and find a
better one.

>> - The generated SQL lacks quoting of identifiers.
>
> SQL generation subsystem will change for next patch, because I want to
> generate tables first and later add constraints to avoid dependencies and
> when I do that I'm going to add this suggestion.  Just to clarify when you
> said quoting of indentifiers we are talking about quoting tables names and
> columns names?

Yes.

>
>> - The generated SQL isn't syntax highlighted.
>
> Well, right now this wasn't on my schedule but I'll try to do that at last
> week of proposal dedicated to bug hunting and improvement of UI if time is
> enough.

Use a ctlSQLBox instead of a text box and it should just work.

>> Looks interesting... of more interest to me though is reverse
>> engineering of an existing schema. Is that on your roadmap?
>
> Well, in the proposal I have some kind of reverse engineering of tables
> features on my schedule, called table sync because this feature will allow
> to add tables from a schema to the model and then generate a alter table
> instead of a create table for this imported table. But only if model is
> generated to be created at same schema, in other way it generates a create
> table.
>
> This feature allow to choose several tables from same scheme at same time
> and in this way import relationships between selected tables too. But right
> now I haven't any design for it (at the middle of this week after next patch
> I'll start to work on it), and I have not a real idea about how this feature
> will really work.

OK. I'm pretty sure that's a feature that will be requested a lot
(though, probably with CREATEs instead of ALTERs). People will wish to
do something like:

- Generate model from the existing schema.
- Tidy up and annotate the model.
- Print/save.

>> s/A probably solution/A probable solution
>
> :$ sometimes I'm tired and my english that is bad, becomes worst :(

Your English is pretty darn good :-)


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Database Designer report at 28/07/2001

From
"Dickson S. Guedes"
Date:
2011/7/30 Luis Ochoa <ziul1979@gmail.com>:
> On Fri, Jul 29, 2011 at 8:50 PM, Dickson S. Guedes <listas@guedesoft.net>
> wrote:
>>
>> 2011/7/29 Dave Page <dpage@pgadmin.org>:
>> > I just gave it a whirl for the first time (using the code committed to
>> > master, so some of these may be fixed), and immediately ran into a few
>> > issues:
>>
>> I tested here  (from commit b63c368a84) and have some opinions about
>> this cool addition to pgAdmin3:
>>
>> - The icons for "Add an empty table" and "Add a new column to selected
>> table" are the same, they could be different.
>
> Yes Icons are just for testing right now it should be improved.

Ah ok. I supposed that.

>> - The "Short Table Name" length is fixed in 3 characters. That could
>> be customisable.
>
> It can be, but main idea is to create the smallest possible name to create
> constraints easy to read, I'll think about it for last week of my project
> when I'll check UI of the modeler.

Ok.

>> - When adding a foreign key to a table, if the referenced column type
>> is 'serial' the reference column should be 'integer', but it stay
>> 'serial' and isn't possible change because the item for this in the
>> context menu is disabled. So, in this case, it could automatically
>> create an 'integer' reference column in child table when it references
>> a 'serial' column in parent and the equivalent for 'bigserial'.
>
> Ok, my mistake with automatically generation of foreign keys, I'll fix it
> for next patch, but you are able to create a foreign key for an existing
> column, if you table have columns before you add the fk, you are able to
> choose datatype of fk destination column and is on behalf of the user check
> the integrity of it.

Yes I saw this. in fact I did it in this way, but I happy to know that
you'll fix it for next patch.

>> - I have some DOMAINs and TYPEs but they aren't listed when choosing
>> the field type via context menu. This list could be dynamic or there
>> could be a text box to type a custom type.
>
> Yes, this should be improved but because the way this works it would take
> some time and now my schedule is tight, then I'll try to add it after gsoc
> because that is a very important feature but will need a some major changes
> (and time) at columns/tables

Hum, I guess that came from a query but now I see that is hard coded.
Ok, maybe there will be more hands to help improve that after gsoc.

>> - When I close the DbDesigner window after a change it doesn't ask for
>> confirmation and when I reopen it the diagram was lost. It could ask
>> for closing, or clear the diagram only when the 'New model' menu item
>> (or button) was clicked.
>>
>> - When open a model, it could ask for saving the previous model if it
>>
>> has changes.
>
> Yes it need to be added to the modeler, is just I have a lot of things at my
> head right (while working with new features and trying to accomplish it) now
> that I didn't notice simple things like that, I'll fix it for next patch.

Ok, nice! ... and yes, sometimes little things are missed and the more
we help testing the more we found them.

>> - The generated SQL table's definition isn't in dependency order when
>> adding a new parent table to diagram, but the generated script could
>> be ordered by foreign key dependencies.
>
> This will change for next patch, because dependecies are too difficult to
> acomplish always, and I'll generate first the table and then after generate
> all tables add the constraints to each one.

+1.

>> - The visual relation line of self referencing tables isn't displayed,
>> and the reference field couldn't be edited or removed, maybe
>> displaying the relation line would be enough.
>
> This is not possible right now, becasue modeler needs a major change: a new
> kind of lines between figures known as orthogonal lines, and some adjust at
> the modeler and this change wasn't include at my schedule and I tried to do
> it but some complications didn't allow me to do it, in future after gsoc
> I'll do that :)

Good! I hope there will be more hands on this after gsoc.

>> - Compress the generated 'pgd' file using wxZlibInputStream and
>> wxZlibOutnputStream.
>
> Yes this is a good suggesting and in fact I read something about compression
> with libxml2 that automatically uses Zlib, but I didn't activate it and
> tested I'll do this for the last patch.

Cool, but if your time is short you could left it to do after gsoc, maybe.

[]s
Guedes



--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br