August 24th, 2024

Show HN: Visualize database schemas with a single query

ChartDB is an open-source web tool for visualizing and editing database schemas, supporting instant schema import and AI-generated DDL scripts, compatible with multiple databases, and offering community support.

Read original articleLink Icon
CuriositySkepticismEnthusiasm
Show HN: Visualize database schemas with a single query

ChartDB is an open-source, web-based database diagrams editor that enables users to visualize and edit database schemas without the need for installations or database passwords. Key features include instant schema import, which allows users to retrieve their database schema as JSON with a single query, and AI-powered export that generates DDL scripts for various database dialects, aiding in migration between systems. The tool also offers interactive editing capabilities for fine-tuning database schemas. To get started, users can clone the repository, install dependencies, and set up their OpenAI API key for AI functionalities. ChartDB supports multiple databases, including PostgreSQL, MySQL, SQL Server, MariaDB, and SQLite. Community support is available through a Slack channel, and users can report issues on the GitHub Issues page. The project is licensed under the GNU Affero General Public License v3.0, and additional information can be found on the ChartDB website or through its demo.

- ChartDB is a web-based tool for visualizing and editing database schemas.

- It supports instant schema import and AI-powered DDL script generation.

- Compatible with PostgreSQL, MySQL, SQL Server, MariaDB, and SQLite.

- Community support is available via Slack and GitHub.

- Licensed under the GNU Affero General Public License v3.0.

AI: What people are saying
The comments on ChartDB reflect a mix of feedback and inquiries about the tool's features and performance.
  • Some users express skepticism about the AI-generated scripts, questioning their reliability compared to traditional scripting methods.
  • Several commenters appreciate the tool's interface and functionality, with some comparing it to similar tools in the market.
  • There are concerns about accuracy, such as incorrect database names and potential vulnerabilities in generated scripts.
  • Users are curious about the role of AI in the tool and how it differentiates from existing database visualization tools.
  • Suggestions for improvements include better layout options, additional visualization views, and fixing broken links on the website.
Link Icon 22 comments
By @djray - 4 months
I rather think using AI to generate scripts for other DBs is a disadvantage. Scripting is a deterministic process, surely? Can you create a common internal representation and write exporters for each supported DBMS from that? Maybe the JSON format you use is a path toward this.

I dislike the multiple references to 'Magic' on the site, but I realise that's probably a subjective thing. Maybe I'm fatigued by the AI-in-everything trend.

I don't use all the DBMSes you support, but I'm not sure having a single query to run is really much of a selling point. For SQL Server, I'd rather execute a stored procedure with permission checks, and progress feedback, than a big chunk o' SQL. (Again, that may just be a me thing.) If it's an efficiency thing for very large DBs then I think you should emphasise that, and also detail how much faster it is to gather all the info in one fell swoop than if you split up the queries.

The Examples link is currently broken on your site, btw. That sounds like a really useful way that people can evaluate your application without having to run a query on their own DB, which they may be reticent to do for testing out a new app.

By @rustman123 - 4 months
"PostgresSQL"? "SQL Lite"? Not even getting the names of the supported databases right doesn’t create trust…
By @qwertydog - 4 months
Just checked out the MS SQL script. I believe it's vulnerable to SQL injection via table/column/view/index/schema names (however unlikely that may be). You might want a disclaimer not to run the script with object names that could be user provided (especially as a privileged user)
By @amenghra - 4 months
By @webprofusion - 4 months
Not bad! Could do with a layout option so the relations are easier to see.

The OG of DB table designers is the SQL Server database diagrams feature, and before that MS Access, and there is still room for improvement in this tool. Obviously saving changes back to your db (and migration scripts) is the most important feature, git tracking of schema changes would be good.

By @ok123456 - 4 months
How is this different from Schema Spy (https://schemaspy.org)?
By @gitroom - 4 months
This is cool, but there are a lot of visualizer, what's the difference?
By @andrelaszlo - 4 months
> visualize database schemas by generating ER diagrams with just one query

> visualize and design your DB with a single query

> Instantly visualize your database schema with a single "Smart Query."

The tool seems really useful and I will give it a try!

Just curious about the emphasis on the single query. What's the value of this? If it makes it much faster than similar tools it's probably worth making it explicit. I don't use them often enough to know if speed is a big issue (if this is the reason).

Nice work anyway!

By @jesperwe - 4 months
I tried it out on a not so complex Postgres v15 DB. No relations were imported, just the tables?
By @ellyagg - 4 months
Awesome! This is exactly what I wanted last year when I was helping my wife with her reporting and the only access she had to her company's application database was through Redash.
By @1ilit - 4 months
Reminds me a lot of my drawDB: https://www.drawdb.app/. *Not a shameless plug, actually*
By @zola - 4 months
Is there a tool with similar presentation, but for database records and not schema? So I could "select * from product where id=5" and it would show me Product card for "hammer" and related card for Brand "ACME", and other related records which might be many/one to one/many relationship etc. In other words - data exploration tool with diagramming like in here?

I just asked chatGPT for this, but human perspective would be great :)

By @salzig - 4 months
> STRING_AGG aggregation result exceeded the limit of 8000 bytes. Use LOB types to avoid result truncation.

Looks like not all databases (mssql in this case) like the generated result.

By @yencabulator - 4 months
Constructing JSON by hand is not a good idea: https://github.com/chartdb/chartdb/blob/66db34d9114104aaaafa...
By @namanyayg - 4 months
nice work on chartdb, guys!

can you elaborate on how the ai part works? im a bit confused how that fits in because there are many SQL diagram tools without AI as well

By @clidey - 4 months
Hey this is really cool! I love how sleek the interface is. We're doing something similar at WhoDB (https://github.com/clidey/whodb) and love seeing all the work happening in this space.

Congrats on the launch and happy building!

Disclaimer: I'm one of the cofounders of WhoDB.

By @yetanotherdood - 4 months
I think having multiple "views" of these diagrams would be nifty. In addition to the standard visualization, you could have an "index" visualization that also captures foreign keys etc.
By @jalopy - 4 months
This is great. Anyone know how hard it would be to adapt to Athena?
By @samstave - 4 months
huh.. I like to have claude give me a DB schema in a mermaid diagram, infact - I make python scripts to log into the DB, list the DBs, list the schemas, and make a mermaid diagram of the schema and then I have a python script that converts the mermaid code to an SVG.
By @idorube - 4 months
There's a typo on your "Quick Start" button. ("Quck Start")
By @ahaapple - 4 months
I am curious about what great role AI can play in the chartdb project?