Skip to content

Conversation

@kryskool
Copy link
Contributor

@kryskool kryskool commented Nov 7, 2025

Proof of concept for #1070 to keep the HB templates unmodified,

example

select 'modal' as component, '123' as id, 'test' as title, 'Close' as __close

is equivalent to

select 'modal' as component, '123' as id, 'test' as title, 'Close' as close

@lovasoa what do you think ?

@lovasoa
Copy link
Collaborator

lovasoa commented Nov 7, 2025

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.

@kryskool
Copy link
Contributor Author

kryskool commented Nov 7, 2025

It seem double quote on SQL Server is a settings to enable, see SET QUOTED_IDENTIFIER

Causes SQL Server to follow the ISO rules regarding quotation mark delimiting identifiers and literal strings.
Identifiers delimited by double quotation marks can be either Transact-SQL reserved keywords or can contain characters not generally allowed by the Transact-SQL syntax rules for identifiers.

Maybe just adding aliases to properties with names that conflict with keywords is the best solution ?

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_

@lovasoa
Copy link
Collaborator

lovasoa commented Nov 7, 2025

We can already write 'Close' as [close] without any additional config.

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.

@kryskool
Copy link
Contributor Author

kryskool commented Nov 8, 2025

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.

@kryskool kryskool closed this Nov 10, 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.

2 participants