inukshuk / sqleton

Visualize your SQLite database schema
GNU General Public License v3.0
110 stars 12 forks source link

What about PostgreSQL or other databases? #3

Open tatsujb opened 6 years ago

tatsujb commented 6 years ago

You say "sqleton was written to visualize SQLite schemata. Having said that, you can try to dump your schema and create a new SQLite database for visualisation from it."

that's far from being an option in my case. how would one go about converting your code to make it work with postgres instead.

if it's relatively quick I'll do it and make it available on NPM and github like you did. but if it requires your expertise would you be willing to do it and do you have a patreon or something?

inukshuk commented 6 years ago

Since the SQLite syntax parser is rather forgiving in terms of accepting syntax used by other databases, I believe that by dumping the schema and removing unique or advanced features (e.g., procedures, indices) it wouldn't be too much effort to make SQLite parse the bare bones of the schema -- the part that is actually relevant for the visualization (i.e., tables, columns, foreign key constraints).

Admittedly, I have not used sqleton for anything but SQLite database so this may very well be wishful thinking. Why is not an option in your case?

If it's not an option to get your schema into SQLite it should not be hard to add Postgres support: sqleton simply turns table definitions into graphivz nodes and foreign key constraints into edges. So if you can write a quick script (ideally using native promises) that connects to the database and fetches all tables, with all their columns and keys, that's basically all there is to it.

Happy to help out and accept a PR if you want to take a stab at it.