-
Notifications
You must be signed in to change notification settings - Fork 606
Open
Description
Feature Request: Multiline Labels for sql_table Title
Summary
Enable multiline strings in the sql_table title/label.
This feature would improve readability and expressiveness when creating high-level data models, especially when using the new suspend / unsuspend functionality introduced in D2 v0.7.
Problem / Motivation
Currently, the sql_table title supports only a single-line label.
However, when building conceptual or logical data models, it is often necessary to include:
- additional descriptions of the entity
- business context
- module or subsystem names
- indicators of how/where the model was generated (e.g., via
suspend) - metadata such as version, status, or classification
Without multiline labels in the table header, users must either clutter the diagram with separate comment nodes or omit important context.
Proposed Solution
Allow the sql_table title to accept multiline strings, for example:
sql_table Users {
label: "Users\n(Conceptual Model)"
}or using | strings:
sql_table Users {
label: |
Users
(Conceptual Model)
|
}Expected behavior:
- the table header expands vertically when multiline text is used
- all lines are rendered inside the header cell
- alignment remains consistent with existing themes
- exports (SVG/PNG) preserve multiline formatting
Why This Should Be in Core
- Enables more expressive and readable data models.
- Matches expectations from ERD and data modeling tools.
- Complements the new
suspend/unsuspendfeatures introduced in D2 v0.7. - Backwards-compatible and does not change current behavior.
skwaugh
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status