DBML is a simple DSL for defining and documenting database structures in plain text. It stays database-agnostic and focuses on tables, fields, refs, and notes.
Overview
DBML expresses schemas declaratively so developers can read and maintain structure without dialect-specific DDL noise. Tables, columns, enums, relationships, and inline notes capture intent at a logical level rather than physical creation commands.
The ecosystem includes a command-line converter between DBML and SQL DDL, JavaScript modules such as @dbml/core for programmatic translation, and community parsers and editor plugins in many languages. Companion web tools visualize diagrams and publish documentation from the same source files.
Project guidance suggests keeping a database.dbml file alongside application code, similar to other project metadata, so schema design stays versioned and reviewable. DBML is intentionally declarative where SQL DDL is imperative and vendor-specific.
Holistics maintains the language and related open tooling; users can extend the ecosystem by contributing parsers, generators, or integrations listed on the official ecosystem page.
Key features
- Declarative table definitions
- Relationship ref syntax
- Column notes and enums
- Database-agnostic modeling
- SQL DDL conversion CLI
- JS core conversion library
- Diagram and doc tooling
- Community parser plugins
Use cases
- Documenting database schemas
- Sharing database schema source in Git
- Converting models to SQL DDL
- Team database design reviews
- Feeding diagram generators