How to create database diagram animations
Intro
These are the technologies and programs I will be using:
I assume you have a postgresql database up and running with at least one table.
Export postgreSQL database schema
Run this bash script, and replace the command arguments for your environment, to get your database schema.
pg_dump -h <host> -p <port> -d <database_name> -U <username> -s -F p -E UTF-8 -f <output_path>
You will get an .sql
file as a result of this script.
Generate database schema SVG in dbdiagram.io
-
Create a new diagram.
-
Import schema from postgresql
- Rearange the tables to your liking
- Export as a SVG file
Customize diagrams and animate frames in Figma
-
Create new figma project
-
Drag and drop your SVG database schema into the project
-
Customize the look and feel of your tables
-
Duplicate SVG to create multiple frames. Create "slices" of the database to present different views of your schema. For animation to look the best between frames, keep the tables in the same position across frames.
-
Go into "prototype" mode, connect frames and define interactions between them. For example: