jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Other
40.69k stars 7.57k forks source link

Connect tables with foreign keys when inserting from SQL Script #1178

Closed Eddie-Hartman closed 2 years ago

Eddie-Hartman commented 4 years ago

Is your feature request related to a problem? Please describe. /pull/233 It would be nice to have diagram tables connect to each other when they have foreign keys defined when adding via a sql script.

Describe the solution you'd like So to begin with, there is a bit of confusion if you look at the pull request listed above. There is the SQL import plugin, and a SQL import baked into Draw.io. Neither of these support linking foreign keys between tables currently. The sql server example from the SQL import plugin looks about the closest right now, so I'm basing my example off of that.

Following these clicks produces result shown as 5: image

Preferred output: image

Notice the addition of the directional connector from one row to the other to indicate the relationship.

Describe alternatives you've considered https://github.com/dbeaver/dbeaver/issues/7067 Exporting from an existing diagramming software to graphml and then importing into draw.io.

Additional context The existing advanced option (arrange, insert, advanced, from sql) for importing does not support this type of script and produces strange output: image Note that I used the same script as above except for adding a primary key to the personID.

CREATE TABLE Persons
(
PersonID int primary key,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);

CREATE TABLE Orders (
    OrderID int NOT NULL,
    PRIMARY KEY (OrderID),
    CONSTRAINT FK_PersonOrder FOREIGN KEY (OrderID)
    REFERENCES Persons(PersonID)
);

This could possibly be considered a separate bug, but it just seems strange that the plugin supports more than the one integrated into the core application, although in my opinion the core's output is more visually appealing especially since it includes data types.

Eddie-Hartman commented 3 years ago

@alderg @davidjgraph Sorry for the direct pings, but should I be doing something else with these submitted issues? They are getting closed due to being stale with no activity.

I can understand being busy, but then maybe extend the stale bot time? Or if they ARE being seen, acknowledge that it isn't a priority and move on? Just getting no feedback then having them closed isn't a great interaction.

davidjgraph commented 3 years ago

You're welcome to have them re-opened and marked as not stale if you don't feel it should be closed.

cecabrera commented 3 years ago

Hello. It should be it opened as it has not been resolved. I am having the same issue :). Thanks in advanced!

Xetoxyc commented 2 years ago

Issue exists over one year now.

Is this feature planned already ?

davidjgraph commented 2 years ago

No, I'll close to reflect this.

kddsultan commented 2 years ago

Would be great to see the feature grow further. @davidjgraph, how could a potential contributor like me would be helpful here?