Repository navigation
fix(core): export the Project block in the DBML exporter - #1034
Merged
huydo862003 merged 2 commits intoNov 12, 2026
Merged
Conversation
huydo862003
approved these changes
Nov 12, 2026
huydo862003
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your contribution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DbmlExporterdid not write theProjectblock, so exporting DBML to DBML dropped the project name,database_typeandNote. The example from the issue returned an empty string.Projectblock first, with the name (when there is one),database_typeandNote. Values are escaped with the existingescapeNote, so the output parses back to the same project. A file without aProjectgives the same output as before.Example:
Issue
#285
Lasting Changes (Technical)
DbmlExporter.exportProject.table_group_settingsexporter fixture has a project (name: "a",database_type: "aaa'hehe"), so its expected output now starts with theProjectblock.exporter.export(..., 'json')is the normalized model, whichimporter.import(..., 'json')can't read back, so that path still fails before reaching the exporter. Passing the normalized JSON toModelExporter.export(..., 'dbml')now keeps the project.Checklist
dbml-homepage/static/llms.txt(if docs/features changed)Docs and
llms.txtdon't need changes since the syntax is the same.@dbml/coretests: 454 passed. The new tests and the updated fixture fail without the change. In@dbml/cli, the 4db2dbmltests fail the same way on master in my environment because they need live databases.