ondras / wwwsqldesigner

WWW SQL Designer, your online SQL diagramming tool
https://sql.toad.cz/?keyword=online_library
BSD 3-Clause "New" or "Revised" License
2.87k stars 725 forks source link

Reverse Enginering support For Postgres? #272

Closed martinmurciego closed 5 years ago

martinmurciego commented 6 years ago

Good tool. I am interested in the function of drawing the diagram doing inverse engineering of a sql script (DDL) of a postgres database.

ondras commented 5 years ago

I would love to see the feature as well. Alas, my PSQL knowledge is rather limited and implementing the necessary import server-side call requires a skilled/experienced PSQL developer.

If you are a postgres guy, you might want to have a look at https://github.com/ondras/wwwsqldesigner/blob/master/backend/php-postgresql/index.php -- there already is some code for importing schema from Postgres, but I have no idea whether that works or not.

martinmurciego commented 5 years ago

I would like to collaborate on a tool like this although I only have some knowledge / experience in: PSQL (Postgres), Javacript and Node js. And none in PHP I can only comprehend roughly the code that I read, but not modify it and set it up. I look at it and see how I can help it.

ondras commented 5 years ago

And the existing php-postgresql backend is not working for you? Does it import any data?

martinmurciego commented 5 years ago

I can only tell you that the queries used are working perfectly for version 9.5 of postgres that I am using. It works to recover names of: tables, columns, PK, FK. It would be necessary to create a correspondence between Postgres data types and MySQL data types as some tools that normally distinguish a logical model from a physical model do to separate the definitions of those data types in the database engines. I would fail to try this code to see how to run it but the queries have access to the schema or catalog of the database. If I'm not mistaken, the only tool does not pay that I found that does this reverse engineering is dBeaver (Community Edition).

In the options of this tool you can choose Postgres but when saving is not available. I do not know if there is a specific version of this repository loaded. Sorry if I still do not take time to install everything that is required and run the script in php is that I'm somewhat busy in a project, but I think it is interesting to collaborate in what is within my reach.

ondras commented 5 years ago

Well, I am puzzled now. If the existing code works, what is this Issue / Feature request about? I thought that the current implementation for schema import is flawed in some way...

martinmurciego commented 5 years ago

It is a good tool to excuse me if I understood how it works.