This major mode attempts to port all of the syntax highlighting from https://dbdiagram.io and build upon it by providing helpers such as duplicate checking and rendering SVGs directly in Emacs.
Install it from Melpa or clone and
install manually, then simply M-x dbml-mode
.
It might be useful to auto-enable the mode for certain files or patterns. One
of such methods is updating auto-mode-alist
:
(add-to-list 'auto-mode-alist
'("\\.dbml\\'" . dbml-mode))
For every file with .dbml
extension.