🧠 Second Brain
Search
DBML
DBML (Database Markup Language) is an open-source DSL language designed to define and document database schemas and structures. It is designed to be simple, consistent, and highly readable.
It also comes with a command-line tool and open-source module to help you convert between DBML and SQL.
# Benefits
- It is simple, flexible, and highly human-readable
- It is database agnostic, focusing on the essential database structure definition without worrying about the detailed syntaxes of each database
- Comes with a free, simple database visualizer at dbdiagram.io
- Also comes with a free database documentation app at dbdocs.io
# Example
|
|
More on GitHub and DBML - Full Syntax Docs | DBML.
See the above dbml doc visualized on dbdiagram, DBDiagram has a beautiful integration into it.
Used at the Airbyte’s first Hack Days building the ERDs, e.g. dbdocs.io - Database Documentation and Catalog Tool as an example.
# DDL to DBML conversion
Import from Postgres:
# With DbBeaver export
Mark tables and right click -> Tools -> Backup
and then these settings for an equivalent of pg_dump -h <host> -p <port> -d <database_name> -U <username> -s -F p -E UTF-8 -f <output_path>
:
Origin: Crafting an Automatic ERD Generator: A Journey from DDL to Diagram | by DevTools Daily | Medium
# Integrations
Origin:
References:
Created 2022-09-22