distal-attribute
distal-attribute
distal-attribute
distal-attribute

Always Back-ticks Enclosed

charlretief posted 3 years ago in Feature discussion
I sometimes use restricted words in my table names and fields like 'transaction', 'time', 'date' etc. thus I have to enclose these in `back-ticks` to make all setups of mysql accept this.

To make my SQL consistent and thus pretty I have a habit of typing all table names and field names in the optional `back-ticks` enclosed.

If heidiSQL has a option in the preferences for the "always use back-ticks" then the fields inserted from the left and right treeview would conform to this standard.

============

I know `backticks` are mostly optional but my personal preference is to always use them. I don't want to request this a a feature if I am the only user that does this. So lets see if there are others that would also benefit form such a feature.
ansgar posted 3 years ago
Was discussed earlier here.
ansgar posted 3 years ago
The problem with backticks everywhere for most users was that this results in unreadable SQL queries. So I implemented a logic which just adds backticks on reserved words - which does currently not work for data types such as "date" and "time". I'll check that.
charlretief posted 3 years ago
Yes, I just read the revision log.

The reason why I like backticks everywhere is because I use different mySQL editors on the same db's. I find the sql syntax color highlighting is more consistent and readable between different editors when all fields are always backtick enclosed.


That is way I asked if more users would benefit from an option in the preferences to toggle the "AlwaysQuote" behavior for code dropped in the sql editor.
ansgar posted 3 years ago
Well you are the first to ask for such an option - for experience reasons I'm hesitating to say "yes let's make it optional". Hmm.
kalvaro posted 3 years ago
A little side note... MySQL itself has a setting related to this, the sql_quote_show_create session variable:

- http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_sql_quote_show_create

Currently, HeidiSQL needs that this variable is set to ON:

- http://www.heidisql.com/forum.php?t=7802

I'm wondering whether it would make sense to read this variable and use it for... well, for something.


In any case, I think the always quote behaviour should be at most optional. I particularly hate having all those backticks all around.
ansgar posted 3 years ago

wrote: I particularly hate having all those backticks all around.


Yes, that's what I think too and I didn't hear the opposite from anyone until now.

Please login to leave a reply, or register at first.