4 ms·
OP here. Sharing a bit of history on DBML. Originated from dbdiagram.io, a simple tool that we built to help you draw ER diagram by using writing code [1]. We
by huy 7y ago
OP here. Sharing a bit of history on DBML.
Originated from dbdiagram.io, a simple tool that we built to help you draw ER diagram by using writing code [1]. We shared that project on HN about a year back. Since then it has been growing organically and reach over 80k users.
When we launched, what our users like most about that tool is the ability to write simple DSL language and get the chart visualized. Then over time, we started to see our users using that DSL language to document their internal database structure (without the necessary need to visualize it). They were using it as a database documentation/definition language.
Realized this is something we can add more value to the community, DBML was then born as a simple language to help you design, document and communicate your database structure with other developers. DBML is also open-sourced and would welcome contributions [2].
Basically with DBML you can:
- Have a simple db.dbml file to document your database schemas, with proper context and descriptions
- Your dbml file becomes the central source of truth of your database definition
- Using simple CLI command to generate SQL creation file from DBML
[1] https://news.ycombinator.com/item?id=18066881 https://news.ycombinator.com/item?id=18066881
[2] http://github.com/holistics/dbml http://github.com/holistics/dbml
- somada141 7y agoThat's brilliant, both the editor and the language. I've long designed schemata on tools like MySQL Workbench [0] which didn't make it easy to iterate with other devs before settling on a final schema but this should make it far easier! [0] https://www.mysql.com/products/workbench/ https://www.mysql.com/products/workbench/
- RobGoretsky 7y agoGiven that this is a declarative language, have you given thought to creating a means of generating the (imperative) DDL needed to alter tables if the DBML is updated? My team has been storing DDL in our GitHub repo and we have a basic script run by our CI/CD tool to deploy that DDL upon push to master, but it would be great if that could be extended to handle cases where the DDL is modified.
- huy 7y agoThat’s a great idea. We’ll certainly consider it in the near future.
- Noumenon72 7y agoYou really sell that well in your link, telling me just why it's useful compared to DDL and giving useful tools.