Connect tables with foreign keys when inserting from SQL Script
See original GitHub issue- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
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:
Preferred output:
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: 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
No, I’ll close to reflect this.
Would be great to see the feature grow further. @davidjgraph, how could a potential contributor like me would be helpful here?