Dbdiagram pull does not pull the Text comments?

dbdiagram pull --diagram-id -o jira.dbml downloads the DBML, but all the text comments are missing. However, if I download the DBML using the UI, everything is fine.

Jay

Hi @JayOnSoftware,

This is expected (and confusing) and currently, we’re working to improve this.

The reason is that dbdiagram and dbdocs store separate copies of the DBML. Notes you add directly in dbdocs (via the markdown editor) live only in the dbdocs copy, so dbdiagram pull won’t include them since it pulls from dbdiagram’s copy.

Two workarounds for now:

  1. Copy-paste the DBML from dbdocs back into dbdiagram so both copies stay in sync, then pull will include everything.
  2. Avoid editing notes in dbdocs. Instead, add your notes in dbdiagram instead (using DBML Note blocks, then you’ll able to edit in markdown editor that similar to dbdocs when hovering on the table/field) and treat dbdiagram as the single editing source. Then you can publish from dbdiagram to dbdocs and dbdocs will stay up to date.

We do plan to improve this sync flow in the future. For now, keeping dbdiagram as the source of truth is the most reliable approach.

I love the dbdocs editing function (Our non-technical folks love it). Is there a way to automate it so we can copy from docs to diagram?

So dbdocs CLI can’t pull a dbdocs to the local file system?

After discuss with the team, we’re considering to add the pull doc content from dbdocs next week. We’ll let you know when it is available.

Let me know when this is up, i am creating an MCP server to expose dbml files, it will be nice to just connect directly to the api then right now download and upload to git

2 Likes

Hi @JayOnSoftware ,

Sorry for the late reply.

The dbdiagram CLI is now supporting pulling DBML from a dbdocs project.

Please update it to the latest version v0.6.0 and use the following command:

dbdiagram pull --project <your_workspace/your_project> -o schema.dbml 

Then your DBML will be pulled along with all note updates.

Please give it a try and let me know your feedback if possible.

Thanks.

1 Like