Discussion:
[Squirrel-sql-users] Graph- how to use?
LeO Welsch
2006-11-14 14:42:18 UTC
Permalink
Hi,

I have added several tables on the Graph and now I wanna add the relation, but the context-menu does not indicate how to do this. The Menu-Item 'add table referenced by (no hit on FK)' is grayed out. Is there a way to add it manually? Or what have I done the wrong way?

LeO
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
Gerd Wagner
2006-11-14 21:46:18 UTC
Permalink
Post by LeO Welsch
Hi,
I have added several tables on the Graph and now I wanna add
the relation, but the context-menu does not indicate how to do
this. The Menu-Item 'add table referenced by (no hit on FK)'
is grayed out. Is there a way to add it manually?
Or what have I done the wrong way?
No there is no way to change things in the database from within a Graph right
now. One day I'll implement it but not in the near future.

Sorry

Gerd

P.S.: If anyone feels like doing it first. Please go ahead I'll be of any help I
can.
Robert Manning
2006-11-14 22:33:25 UTC
Permalink
Post by Gerd Wagner
Post by LeO Welsch
Hi,
I have added several tables on the Graph and now I wanna add
the relation, but the context-menu does not indicate how to do
this. The Menu-Item 'add table referenced by (no hit on FK)'
is grayed out. Is there a way to add it manually?
Or what have I done the wrong way?
No there is no way to change things in the database from within a Graph right
now. One day I'll implement it but not in the near future.
Sorry
Gerd
P.S.: If anyone feels like doing it first. Please go ahead I'll be of any help I
can.
There is work being done at the moment on a plugin (Refactoring) whose
goal is to make typical refactorings (such as adding a foreign key,
among others) possible with a number of different database dialects.
The work that is being done leverages (and extends) Hibernate's
mechanism for generating correct SQL according to the dialect of SQL
for the database that SQuirreL is connected to. It will be some time
(not even going to speculate at the moment) but
adding/modifying/dropping constraints are definitely planned. My
intent here is just a little notification in case someone has decided
to run off and implement this, that there is a framework in place to
accomodate this functionality. And we should probably coordinate
efforts rather than duplicate them.

Rob
Gerd Wagner
2006-11-14 23:05:38 UTC
Permalink
Post by Robert Manning
Post by Gerd Wagner
Post by LeO Welsch
Hi,
I have added several tables on the Graph and now I wanna add
the relation, but the context-menu does not indicate how to do
this. The Menu-Item 'add table referenced by (no hit on FK)'
is grayed out. Is there a way to add it manually?
Or what have I done the wrong way?
No there is no way to change things in the database from within a Graph right
now. One day I'll implement it but not in the near future.
Sorry
Gerd
P.S.: If anyone feels like doing it first. Please go ahead I'll be of any help I
can.
There is work being done at the moment on a plugin (Refactoring) whose
goal is to make typical refactorings (such as adding a foreign key,
among others) possible with a number of different database dialects.
The work that is being done leverages (and extends) Hibernate's
mechanism for generating correct SQL according to the dialect of SQL
for the database that SQuirreL is connected to. It will be some time
(not even going to speculate at the moment) but
adding/modifying/dropping constraints are definitely planned. My
intent here is just a little notification in case someone has decided
to run off and implement this, that there is a framework in place to
accomodate this functionality. And we should probably coordinate
efforts rather than duplicate them.
You are absolutely right. I would even try to use the refactoring Plugin from
within a Graph. Some time ago I introduced a mechanism that allows Plugins to
communicate with each other. I did that to use the Scrips Plugin from within the
Graph Plugin.

One suggestion for the Refactoring Plugin: Could you allow to generate DDL
Scripts in the SQL Editor?


Gerd
Robert Manning
2006-11-15 02:34:06 UTC
Permalink
Post by Gerd Wagner
You are absolutely right. I would even try to use the refactoring Plugin from
within a Graph. Some time ago I introduced a mechanism that allows Plugins to
communicate with each other. I did that to use the Scrips Plugin from within the
Graph Plugin.
One suggestion for the Refactoring Plugin: Could you allow to generate DDL
Scripts in the SQL Editor?
Absolutely. I was thinking maybe a configuration (or button in
addition to the 'Show SQL') that would copy the refactoring SQL to the
editor and possibly execute it. At the moment, you can copy the SQL
from the dialog (ErrorDialog was probably a poor choice, I know) and
paste it into the SQL Edit tab. But I think it would be better to
give that option directly. It might have some overlap with the
SQLScripts plugin at some point. I was also thinking that the SQL
Scripts plugin can benefit from dialects for creating table scripts by
prompting the user to pick a target dialect to write the table script
in.

Once the refactoring plugin is reasonably complete (say in 20 years :)
and if no one else has implemented this in open source, the next
plugin that would be really nice to have is the database diff plugin.
For now you can simulate it by creating table scripts then diffing
them as regular files. It sure would be nice to combine the diff and
refactoring capabilities.
So many ideas, so little time...

Rob
Gerd Wagner
2006-11-15 21:58:33 UTC
Permalink
Post by Robert Manning
Post by Gerd Wagner
You are absolutely right. I would even try to use the refactoring Plugin from
within a Graph. Some time ago I introduced a mechanism that allows Plugins to
communicate with each other. I did that to use the Scrips Plugin from within the
Graph Plugin.
One suggestion for the Refactoring Plugin: Could you allow to generate DDL
Scripts in the SQL Editor?
Absolutely. I was thinking maybe a configuration (or button in
addition to the 'Show SQL') that would copy the refactoring SQL to the
editor and possibly execute it. At the moment, you can copy the SQL
from the dialog (ErrorDialog was probably a poor choice, I know) and
paste it into the SQL Edit tab. But I think it would be better to
give that option directly. It might have some overlap with the
SQLScripts plugin at some point. I was also thinking that the SQL
Scripts plugin can benefit from dialects for creating table scripts by
prompting the user to pick a target dialect to write the table script
in.
@Leo Sorry for some more "Geek" stuff. But your questions led us to some
technical aspects that may be important.

@Rob I see the overlap too and just want to encourage you to feel free to move
things around to avoid duplicated code. You may freely move things from or to
the Refactoring Plugin, Script Plugin, core. I haven't got a clear idea what
would be best. Just try out what feels best. Maybe even the existing dependency
between the Graph and the Scripts Plugin could be removed.
Post by Robert Manning
Once the refactoring plugin is reasonably complete (say in 20 years :)
and if no one else has implemented this in open source, the next
plugin that would be really nice to have is the database diff plugin.
For now you can simulate it by creating table scripts then diffing
them as regular files. It sure would be nice to combine the diff and
refactoring capabilities.
So many ideas, so little time...
Surely better than the other way around. Just do what's most fun at the moment
and never hurry. Colin once said "SQuirreL is just a hobby." It's always
important to keep that in mind. :-)

Gerd

LeO Welsch
2006-11-15 10:09:44 UTC
Permalink
-------- Original-Nachricht --------
Datum: Tue, 14 Nov 2006 17:33:25 -0500
Von: "Robert Manning" <***@gmail.com>
An: "Gerd Wagner" <birgit-und-***@t-online.de>
Betreff: Re: [Squirrel-sql-users] Graph- how to use?
Post by Gerd Wagner
Post by Gerd Wagner
Post by LeO Welsch
Hi,
I have added several tables on the Graph and now I wanna add
the relation, but the context-menu does not indicate how to do
this. The Menu-Item 'add table referenced by (no hit on FK)'
is grayed out. Is there a way to add it manually?
Or what have I done the wrong way?
No there is no way to change things in the database from within a Graph
right
Post by Gerd Wagner
now. One day I'll implement it but not in the near future.
Sorry
Gerd
P.S.: If anyone feels like doing it first. Please go ahead I'll be of
any help I
Post by Gerd Wagner
can.
There is work being done at the moment on a plugin (Refactoring) whose
goal is to make typical refactorings (such as adding a foreign key,
among others) possible with a number of different database dialects.
The work that is being done leverages (and extends) Hibernate's
mechanism for generating correct SQL according to the dialect of SQL
for the database that SQuirreL is connected to. It will be some time
(not even going to speculate at the moment) but
adding/modifying/dropping constraints are definitely planned. My
intent here is just a little notification in case someone has decided
to run off and implement this, that there is a framework in place to
accomodate this functionality. And we should probably coordinate
efforts rather than duplicate them.
Rob
Sorry, do not wanna interfere the developers Geek-language ;) Is it right to summarize it the following way?

Currently not possible, as well not in near future. A refactoring Plugin is currently developed, which would provide that kind of functionallity. The purpose of this plugin is for Developers of Squirrel only. The Graph would provide this feature, if Constrainsts would be addable (through the refactoring Plugin) in the Graph-View.

Perhaps I misunderstood some things, but I hope nobody complains too much about this ;)

MY understanding from the Graph was that it is merley for visualization and not so much for adding constraints and references to the Table. And therefore I am interested to add as Visualization the logical connections.

Since I have little bit different understanding about how the Graph is currently used, I am interested in what is the purpose of this view? *Only* to display some tables and due to some internal mechanism a relationship is generated? Cause the context-menu with 'Add ... tables' does not work as well. And ordering the names of a DB might be helpful, but ...

Sorry for these questions, but the manual is not very eloquent about the Graph.

:)

LeO
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
Robert Manning
2006-11-15 10:31:34 UTC
Permalink
Post by LeO Welsch
-------- Original-Nachricht --------
Datum: Tue, 14 Nov 2006 17:33:25 -0500
Betreff: Re: [Squirrel-sql-users] Graph- how to use?
Currently not possible, as well not in near future. A refactoring Plugin is currently developed, which would provide that kind of functionallity. The purpose of this plugin is for Developers of Squirrel only. The Graph would provide this feature, if Constrainsts would be addable (through the refactoring Plugin) in the Graph-View.
Yes, with the exception that the refactoring plugin is intended for
users of SQuirreL.
Post by LeO Welsch
MY understanding from the Graph was that it is merley for visualization and not so much for adding constraints and references to the Table. And therefore I am interested to add as Visualization the logical connections.
Since I have little bit different understanding about how the Graph is currently used, I am interested in what is the purpose of this view? *Only* to display some tables and due to some internal mechanism a relationship is generated? Cause the context-menu with 'Add ... tables' does not work as well. And ordering the names of a DB might be helpful, but ...
Sure, but as I have used it, I thought I can remember that it uses
foreign keys to render dependency lines between fields in the tables.
So, a child column which is a member of a foreign key to a parent
primary key column in a different table will be shown on the graph
when both tables are added in such a way that the child column has a
line with an arrow pointing to the parent column. So, if you want to
have the graph plugin show relationships visually, you must - for the
foreseeable future - define foreign keys using regular SQL in
SQuirreL. Sorry if this all wasn't clear from our conversation. If
you have any other questions, feel free to ask.

Rob
LeO Welsch
2006-11-15 11:55:28 UTC
Permalink
Post by Robert Manning
Sure, but as I have used it, I thought I can remember that it uses
foreign keys to render dependency lines between fields in the tables.
So, a child column which is a member of a foreign key to a parent
primary key column in a different table will be shown on the graph
when both tables are added in such a way that the child column has a
line with an arrow pointing to the parent column. So, if you want to
have the graph plugin show relationships visually, you must - for the
foreseeable future - define foreign keys using regular SQL in
SQuirreL.
Wouldn't it be useful to add exactly the above paragraph to the Help-File?
Post by Robert Manning
Sorry if this all wasn't clear from our conversation. If
you have any other questions, feel free to ask.
Since I haven't yet defined any kind of FK, where do I see them in the Objects-overwiew? On the imported Keys?

Perhaps a screenshot, where do you see the FK displayed in your Graph-relation would be useful as well for the Help-File.

ThX for making clear, what the whole thing is good for.

:)

LeO
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
Gerd Wagner
2006-11-15 21:25:42 UTC
Permalink
Post by LeO Welsch
Post by Robert Manning
Sure, but as I have used it, I thought I can remember that it uses
foreign keys to render dependency lines between fields in the tables.
So, a child column which is a member of a foreign key to a parent
primary key column in a different table will be shown on the graph
when both tables are added in such a way that the child column has a
line with an arrow pointing to the parent column. So, if you want to
have the graph plugin show relationships visually, you must - for the
foreseeable future - define foreign keys using regular SQL in
SQuirreL.
Wouldn't it be useful to add exactly the above paragraph to the Help-File?
That has just been done in CVS and will be available in future releases.

Thanks

Gerd
Loading...