sqlitestudio icon indicating copy to clipboard operation
sqlitestudio copied to clipboard

ER diagram (aka ERD) capability for database schema

Open pawelsalawa opened this issue 7 years ago • 12 comments

(This issue was migrated from the old bug tracker of SQLiteStudio)

Original ID from old bug tracker: 2977 Originally created at: Thu Nov 19 17:34:47 2015 Originally last updated at: Thu Nov 19 17:34:47 2015

Hi Support

Lovely software, it would be a good feature if you could view all tables and relationships between tables, similar to MSSQL.

Being able to view the tables is a nice feature, also move and re-arrange the relationship links, it's very useful to be able to print the diagram.

I know this must be loads of work, however many users would benefit from an improved set of features like this.

Thanks.

Best Regards Steve

pawelsalawa avatar Jan 18 '18 10:01 pawelsalawa

@pawelsalawa Any update about the feature or a good free tool where we can design the diagram and then maybe import it into sqlitestudio? I found dbdiagram.io (free but not super friendly) and dbdesigner.net (free for small projects only)

fastlater avatar Mar 07 '19 02:03 fastlater

No update. I'm short of time so currently I don't do major features.

pawelsalawa avatar Mar 07 '19 12:03 pawelsalawa

@pawelsalawa no worries.

fastlater avatar Mar 10 '19 09:03 fastlater

Some sample code DB/ER Diagrams:

  1. sqlite3todot.c (C) C-language implementation of ER diagrams in less than 200 lines of code -- creates .dot files for graphviz https://github.com/chunky/sqlite3todot/blob/master/sqlite3todot.c

  2. ERAlchemy (Python) Python program generates Entity Relation (ER) diagram from databases. The database is specified as a SQLAlchemy database url. ERAlchemy requires GraphViz to generate the graphs and Python. https://github.com/Alexis-benoist/eralchemy

JimCallahanOrlando avatar Sep 02 '22 23:09 JimCallahanOrlando

Would be a great feature! As a teacher, I'd like to make things clearer to my students and it would be cool having everything in one tool. Currently I'm using mermaid.live to create diagrams, but I/my students can't check (graphically) whether tables are correct implemented.

creativecat avatar Nov 06 '22 12:11 creativecat

Keeping this here just for reference: https://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-example.html

pawelsalawa avatar Nov 21 '22 20:11 pawelsalawa

Another one for reference: https://ogdf.uos.de/

pawelsalawa avatar Jan 15 '23 23:01 pawelsalawa

Yet another useful reference: https://github.com/ArsMasiuk/qvge

pawelsalawa avatar Apr 21 '23 21:04 pawelsalawa

Update on work in progress.

  • Diagram is already rendering and is responsive to drag&drop.
  • It uses GraphViz library for automated layout of entities, leveraging FDB and NEATO algorithms.
  • It parses real schema of existing database.
  • It allows adding entities by user and connecting them with references.

What's left:

  • simple/fast editing of entities in-line and full editing in separate window.
  • actually executing user changes to the database (currently it's just a drawing)
  • remembering last positions of entities (without automated positioning every time)
  • choosing different style of referencing lines (curvy, straight, square)
  • field icons (PK, FK, but also UNIQ, etc)

Here's short recording of playing with real schema (I've used sample schema from tutorial I found online: https://www.sqlitetutorial.net/sqlite-sample-database/ ) parsed and rendered: Recording 2023-05-02 at 23 44 02

pawelsalawa avatar May 02 '23 21:05 pawelsalawa

I like the implementation so far. I am excited for this feature to release.

I would like to see:

  • Color coding
  • Show the type in the column if there is one
  • Press a button to automatically organize the diagram

Here is an image showing the same feature that is in another program.

image

Here is another image image

deborah86 avatar May 11 '23 14:05 deborah86

As mentioned in my previous post, there are already 2 buttons to organize diagram automatically - each button for different algorithm used to organize (FDB and NEATO). You can see them used on my recording.

Column type representation is planned. Also constraint icons are planned.

What is color coding? I mean is it like you apply a color of your choice to a table header and that's it?

pawelsalawa avatar May 11 '23 19:05 pawelsalawa

What is color coding? I mean is it like you apply a color of your choice to a table header and that's it?Yes, that is exactly it. I am happy those features are planned. -------- Original message --------From: Paweł Salawa @.> Date: 5/11/23 12:42 PM (GMT-08:00) To: pawelsalawa/sqlitestudio @.> Cc: deborah86 @.>, Comment @.> Subject: Re: [pawelsalawa/sqlitestudio] ER diagram capability for database schema (#2865) As mentioned in my previous post, there are already 2 buttons to organize diagram automatically - each button for different algorithm used to organize (FDB and NEATO). Column type representation is planned. Also constraint icons are planned. What is color coding? I mean is it like you apply a color of your choice to a table header and that's it?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

deborah86 avatar May 11 '23 22:05 deborah86