prefix SQL keyword with double undescore#1088
Conversation
|
Thanks. However, I'm not sure adding two underscores is easier than adding quotes around the keyword. select 'modal' as component, '123' as id, 'test' as title, 'Close' as "close"Is IMHO just as readable. Maybe just adding aliases to properties with names that conflict with keywords is the best solution ? So that users don't even have to think about it, can copy-and-paste from the docs and get going whatever database they are using. |
|
It seem double quote on SQL Server is a settings to enable, see SET QUOTED_IDENTIFIER
i don't know if duplicate properties is a best solution, that's why in this POC i prefer to keep the original property and protect it with double underscore (works for all properties), i can also change to use underscore as prefix and suffix, like select 'modal' as component, '123' as id, 'test' as title, 'Close' as _close_ |
|
We can already write I think aliases are better for the developer. We can just deprecate the old name, even remove it from the documentation in newer versions, and add a new name without conflicts. |
|
no worries about aliases, we can also put a warning on a log when "close" keyword is used on modal and alert components to indicate it's deprecated. |
Proof of concept for #1070 to keep the HB templates unmodified,
example
select 'modal' as component, '123' as id, 'test' as title, 'Close' as __closeis equivalent to
select 'modal' as component, '123' as id, 'test' as title, 'Close' as close@lovasoa what do you think ?