Convert SQL to SVG

Turn SQL files into SVG. A picture kept as vectors with real text.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop SQL files on the dialor turn it to pick what to do

A diagram of your database tables.Each table becomes a box, and each foreign key becomes a line between boxes.

  1. What you get

    An SVG picture of your schema as an entity relationship diagram, laid out left to right. The text stays real text, and the picture is kept as vectors.

    Each table is a box headed by its name. It lists its columns in order with their declared types, NOT NULL and generated columns. Primary keys are marked PK and foreign keys are marked FK.

  2. How relations are drawn

    Each foreign key is a line from its column to the column it references. A crow's foot sits on the side that can repeat, and a bar or a circle tells whether the key is required.

    If a foreign key names a table the file does not have, that table is drawn with a dashed border. Tables with no keys between them are set out in a grid.

  3. What changes on the way

    The script is first replayed into SQLite. A dump from MySQL, MariaDB or PostgreSQL is rewritten into SQLite's dialect, so column types become the nearest SQLite ones that keep their name and size, such as varchar(255) or decimal(10,2). ENUM, SET, JSON and arrays show as text.

    Keys added after the data are kept. Views, functions and triggers are left out.

  4. When it stops

    A file with no tables stops with unsupported_elements. A schema of more than 250 tables or 5,000 columns stops with resource_limit.

SQL and SVG.What each format is.

The formats

From · SQL

SQL Script

SQL statements as text. A database dump that any SQL tool can read or replay.

Extensions
.sql
MIME type
application/sql
Kind
Text and data
To · SVG

SVG

Scalable vector graphics in XML. Logos, icons and diagrams that stay sharp at any size.

Extensions
.svg .svgz
MIME type
image/svg+xml
Kind
Images

In your code.The same SQL to SVG conversion through the API, for your app or your agent.

terminal
$ cv convert report.sql report.svg
$ cv convert report.sql report.svg

Questions.What people ask about SQL to SVG.

01OF 04

Yes. Dumps from MySQL, MariaDB and PostgreSQL are rewritten into SQLite's dialect before the diagram is drawn.

No. Views, functions and triggers are left out. Only tables, their columns and their foreign keys are drawn.

Primary keys are marked PK and foreign keys are marked FK. Each foreign key also has a line to the column it references.

A foreign key names a table that the file does not have. That table is drawn with a dashed border.

More conversions.Other ways in and out of SQL and SVG.