Currently I can manually download and upload but love to automate this. What is the best way to do this ? Use the CLI to push and pull from Git and then use the API to upload / download. ? Before I embark on this journey has any one done it ?
It would be amazing if we can sync the data in real time.
Hi Jay,
Just to confirm—are you looking to keep your dbdocs and dbdiagram projects in sync?
The best way to do this is via CI integration. You can treat your DBML file as the “source of truth” in your Git repo and automate the rest:
- For dbdocs: Use the dbdocs CLI in your pipeline to auto-update docs on every push.
- For dbdiagram: Use the dbdiagram Public API in the same pipeline script to refresh your diagrams simultaneously.
This setup ensures your docs and diagrams always match your latest code. To maintain the DBML in your Git repository as a single source of truth, you must change it locally rather than using dbdiagram. If you like the editing experience in dbdiagram, you can use our vscode extension for local editing: VS Code Extension | dbdiagram Docs
Best Regards
Huy Phung