Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Option to turn off backticks

mrforsythexeter's profile image mrforsythexeter posted 11 years ago in Feature discussion Permalink
It would be nice to have an option to turn off back ticks when dragging a column / table etc. into the query unless a space or SQL reserved word is found. I feel the back ticks make the code harder to read, and currently the SQL syntax highlight represents them as a string colour rather than an object.
ansgar's profile image ansgar posted 11 years ago Permalink
Sounds not too bad. Only I guess now you're talking about the column list, tomorrow you request some other function where backticks are added, and so on. Right?
mrforsythexeter's profile image mrforsythexeter posted 11 years ago Permalink
Sorry I have posted a lot of stuff, as I said before.. trying to make the jump from MySQL-Front. It added these back ticks and it really made a mess of clean looking code. If you open a view which has been formatted by Mysql, you will know that the fog created by all the back ticks makes it hard to read. So it was just an idea. Sorry.
ansgar's profile image ansgar posted 11 years ago Permalink
No need to be sorry, really. I'm just a bit overextended by about having 10 open questions with mixed feature requests and bug reports at one time, while my kids are setting my bathroom under water and an ill wife asking me to bring her some medicine. However. I think TMySQLConnection.QuoteIdent could get some more intelligence with a third parameter "AlwaysQuote".
Code modification/commit from ansgar.becker, 11 years ago, revision 3610
Modify identifier quoting logic: - Move QuoteIdent() and DeQuoteIdent() out of TMySQLConnection, make them classless - Remove TMainForm.mask(), instead always use QuoteIdent() - Introduce a third parameter to QuoteIdent(): "AlwaysQuote" - setting this to false will quote only if required - Set AlwaysQuote to false for all stuff which drops some code into the query editor, see http://www.heidisql.com/forum.php?t=6986
ansgar's profile image ansgar posted 11 years ago Permalink
Done in r3610.
mrforsythexeter's profile image mrforsythexeter posted 11 years ago Permalink
Thank you
kalvaro's profile image kalvaro posted 11 years ago Permalink
I didn't really notice how much I missed this feature until I saw it implemented. Thank you very much, Anse!

A little detail: you must also check whether the identifier is a reserved word, e.g. a date column called `date`. **I** don't do such things but it can happen in the wildhappy
kalvaro's profile image kalvaro posted 11 years ago Permalink
About my previous comment... It appears that you do this just fine:

SELECT date, year
FROM my_table


I'm sure there was a case when quoting was necessary but I can't remember which one.

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




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.