-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doesn't draw relationship arrows with output from pg_dump 9.6.10... #10
Comments
can you supply an example which does not work please? |
I have similar problem with missing edges, while not pg_dump, but SQLite schema: CREATE TABLE domains (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
);
CREATE TABLE users (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
domain_id int(11) NOT NULL,
name varchar(100) NOT NULL,
email varchar(100) NOT NULL UNIQUE,
password varchar(150) NOT NULL,
FOREIGN KEY (domain_id) REFERENCES domains(id) ON DELETE CASCADE
);
CREATE TABLE aliases (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
alias varchar(100) NOT NULL,
domain_id int(11) NOT NULL,
user_id int(11) NOT NULL,
FOREIGN KEY (domain_id) REFERENCES domains(id) ON DELETE CASCADE,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
); But the /*
* Graphviz of 'example3.sql', created 2019-06-09 15:45:04.550911
* Generated from https://github.com/rm-hull/sql_graphviz
*/
digraph g { graph [ rankdir = "LR" ];
"domains" [
shape=none
label=<
<table border="0" cellspacing="0" cellborder="1">
<tr><td bgcolor="lightblue2"><font face="Times-bold" point-size="20">domains</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="id"><font face="Times-bold">id</font> <font color="#535353">INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="name"><font face="Times-bold">name</font> <font color="#535353">TEXT NOT NULL</font></td></tr>
</table>
>];
"users" [
shape=none
label=<
<table border="0" cellspacing="0" cellborder="1">
<tr><td bgcolor="lightblue2"><font face="Times-bold" point-size="20">users</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="id"><font face="Times-bold">id</font> <font color="#535353">INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="domain_id"><font face="Times-bold">domain_id</font> <font color="#535353">int (11) NOT NULL</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="name"><font face="Times-bold">name</font> <font color="#535353">varchar (100) NOT NULL</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="email"><font face="Times-bold">email</font> <font color="#535353">varchar (100) NOT NULL UNIQUE</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="password"><font face="Times-bold">password</font> <font color="#535353">varchar (150) NOT NULL</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="FOREIGN"><font face="Times-bold">FOREIGN</font> <font color="#535353">KEY (domain_id) REFERENCES domains (id) ON DELETE CASCADE</font></td></tr>
</table>
>];
"aliases" [
shape=none
label=<
<table border="0" cellspacing="0" cellborder="1">
<tr><td bgcolor="lightblue2"><font face="Times-bold" point-size="20">aliases</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="id"><font face="Times-bold">id</font> <font color="#535353">INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="alias"><font face="Times-bold">alias</font> <font color="#535353">varchar (100) NOT NULL</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="domain_id"><font face="Times-bold">domain_id</font> <font color="#535353">int (11) NOT NULL</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="user_id"><font face="Times-bold">user_id</font> <font color="#535353">int (11) NOT NULL</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="FOREIGN"><font face="Times-bold">FOREIGN</font> <font color="#535353">KEY (domain_id) REFERENCES domains (id) ON DELETE CASCADE</font></td></tr>
<tr><td bgcolor="grey96" align="left" port="FOREIGN"><font face="Times-bold">FOREIGN</font> <font color="#535353">KEY (user_id) REFERENCES users (id) ON DELETE CASCADE</font></td></tr>
</table>
>];
} When i move |
Same problem here. Manually added the relationships between the tables at the bottom of the graph.dot file and now it works fine. The edges statement is missing before the last curly bracket. e.g. a -> {b c d e} |
I had this problem with a postgres 10.12 dump, where it also has some other keywords in the sql dump not considered in the parser defs. |
I believe this issue in relation to sqlite is because |
Unfortunately this seems not to draw relationship arrows with output from pg_dump 9.6.10...
The text was updated successfully, but these errors were encountered: