For those who are interested in integrating dbdiagram in the ORM tools that you’re using, this post serves as a collection of reference tools, tutorials, and work-around to help you achieve that.
Currently, the way to use your ORM models with dbdiagram and dbdocs is to:
- (1) convert your ORM models into dbml - a database markup language from dbdiagram.io
- (2) then you can visualize it through dbdiagram.io interface or generate documentation via dbdocs.io
1. Convert to dbml
Based on the languages and frameworks that you’re using, there’s a specific tool for that:
- Django/Python: GitHub - makecodes/django-dbml: This app can generate a DBML output for all installed models.
- Prisma.js: prisma-dbml-generator - npm
- Drizzle.js: GitHub - L-Mario564/drizzle-dbml-generator: Generate DBML markup from your schema defined with Drizzle ORM.
- Knex.js: GitHub - dumbjs/knex-to-dbml: Generate DBML from a knex.js connection
2. Visualize
- For visualizing and collaborating on database design, simply copy the output from step 1 into dbdiagram.io. Voila!
- For database documentation, use dbdocs CLI to quickly generate documentation from generated
dbml
file from step 1 Quick Start Guide from dbdocs
3. Official support?
Not yet, we’re taking it into consideration. For now we do see Integration with existing ORM tools a great opportunity for ORM users to easily access to dbdiagram and dbdocs.
If you’re actively looking for an active support from dbdiagram, can you help us clarify questions below:
- (1) What programming languages and ORM package are you using?
- (2) In which use case are you using dbdiagram & dbdocs for? How frequent?
- (3) Do current methods of using dbml converter (above) suffice your needs? Why and why not?
- (4) (Optional) Are you open to have online conversation with us (dbdiagram team) for to study more about your use cases?
Regards,