You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of TableGroup rendering in pydbml does not wrap the TableGroup name in double quotes. This can lead to issues when using special characters like dashes (-) in TableGroup names.
If the TableGroup name contains a dash, it may result in syntax errors or unexpected behavior.
Proposed Improvement:
Update the TableGroup rendering logic to wrap TableGroup names in double quotes. This ensures compatibility with special characters and aligns with DBML’s syntax flexibility.
Proposed change in table_group.py:
result+=f'TableGroup "{model.name}" {{\n'
With this change, a TableGroup with a name like mygroup-1 would be rendered as:
TableGroup "mygroup-1" {
"products"
"orders"
}
Benefits:
Enables the use of special characters like -, etc., in TableGroup names.
Improves compatibility and usability when naming TableGroups.
Avoids potential DBML syntax issues caused by unquoted names.
Additional Note:
If the maintainers agree with this improvement, I am happy to contribute a pull request with the necessary code changes and test updates.
Let me know your thoughts!
The text was updated successfully, but these errors were encountered:
Oh, and and if you wish, feel free to create a pull requests with this change, as you suggested. I still have to update the syntax compliance to the latest version anyway : }
The current implementation of TableGroup rendering in pydbml does not wrap the TableGroup name in double quotes. This can lead to issues when using special characters like dashes (-) in TableGroup names.
For example:
If the TableGroup name contains a dash, it may result in syntax errors or unexpected behavior.
Proposed Improvement:
Update the TableGroup rendering logic to wrap TableGroup names in double quotes. This ensures compatibility with special characters and aligns with DBML’s syntax flexibility.
Proposed change in table_group.py:
With this change, a TableGroup with a name like mygroup-1 would be rendered as:
Benefits:
Additional Note:
If the maintainers agree with this improvement, I am happy to contribute a pull request with the necessary code changes and test updates.
Let me know your thoughts!
The text was updated successfully, but these errors were encountered: