Skip to content

fix(d2): quote identifiers to support special characters - #33

Merged
denchenko merged 1 commit into
mainfrom
fix/ISSUE-31-d2-special-chars
Nov 1, 2026
Merged

denchenko merged 1 commit into
mainfrom
fix/ISSUE-31-d2-special-chars

Conversation

@denchenko

Copy link
Copy Markdown
Collaborator

D2 treats "." as a nesting separator, so table names containing dots produced invalid diagrams. ClickHouse tables created by materialized views (e.g. "db..inner_id.") failed to compile with "unexpected text after map key".

Quote every D2 key segment in the schema template. Table names are split at the first dot only, so the schema/database still becomes a container and the remainder is kept as a single table key. Column definitions and reference labels are quoted and escaped as well, which also fixes values containing double quotes.

Closes #31

D2 treats "." as a nesting separator, so table names containing dots
produced invalid diagrams. ClickHouse tables created by materialized
views (e.g. "db..inner_id.<uuid>") failed to compile with
"unexpected text after map key".

Quote every D2 key segment in the schema template. Table names are
split at the first dot only, so the schema/database still becomes a
container and the remainder is kept as a single table key. Column
definitions and reference labels are quoted and escaped as well,
which also fixes values containing double quotes.

Closes #31
@denchenko
denchenko merged commit 9a4a22f into main Nov 1, 2026
5 checks passed
@denchenko
denchenko deleted the fix/ISSUE-31-d2-special-chars branch November 1, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: D2 special characters

1 participant