I am using Joplin for diagramming with Mermaid too. Excellent feature.
Recently, I have seen the availability of Database Markup Language (DBML) for database diagramming and the availability of a (npm) JS package also, which maybe, could enrich the list of Joplin features in that context.
A few years ago I messed about with a similar concept, but never got to the diagram stage - there may even be a dusty Perl script somewhere to parse it. My version was:
User {
id i pk,
name vc(128) [idx],
gender e(m,f),
ipaddress c(15),
notes t
}
Easy enough to work out what's going on. I even used it at work in a few places, but it never really took off once "proper" design tools appeared. These days I could probably auto-build a Mermaid chunk based on the table definition. Right now it would be at the bottom of a lengthy to-do list though.