Skip to content

Conversation

lennymlopes
Copy link
Contributor

Summary:
This PR fixes an incompatibility between exporting and parsing: identifiers containing spaces or non-ASCII characters were exported without quotes, producing DBML that could not be parsed back.

Changes:

  • Added a helper quoteIdentifier(name) that quotes any identifier not matching ^[A-Za-z_][A-Za-z0-9_]*$.
  • Applied quoteIdentifier to all table names, column names, index field names, enum values, and relationship endpoints during DBML export.
  • Escaped " and \ inside quoted identifiers.

Example Before:

Table case_files [headercolor: #175e7a] {
  Customer Report text
}

Example After:

Table case_files [headercolor: #175e7a] {
  "Customer Report" text
}

Why:
Ensures that exported DBML is always valid and re-parsable, avoiding round-trip errors when using non-ASCII or space-containing identifiers.

Tests:

  • Verified round-trip (export → parse → export) produces consistent results.

fixes #581

Copy link

vercel bot commented Sep 17, 2025

Someone is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Sep 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
drawdb Ready Ready Preview Comment Sep 17, 2025 9:40am

Copy link
Member

@1ilit 1ilit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you

@1ilit 1ilit merged commit 283df0a into drawdb-io:main Sep 17, 2025
3 checks passed
ewqazxc pushed a commit to ewqazxc/drawdb that referenced this pull request Sep 22, 2025
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] Missing quotes in DBML exports with umlauts/spaces/non-ASCII characters
2 participants