Backticks in table editor

kalvaro posted 3 years ago in General
HeidiSQL has successfully removed redundant backticks from almost all places, but they remain in the "CREATE code" and "ALTER code" tabs:

ALTER TABLE `contact`
ADD COLUMN `var_number` VARCHAR(20) NULL DEFAULT NULL AFTER `contact_name`;

Would it be feasible to get rid of those as well?
ansgar posted 3 years ago
Oh they remain in more than these two places - they're just removed in the query tab features. But probably you're right - why not remove useless and annoying backticks wherever they touch the users eye.
ansgar posted 3 years ago
Done in r3938
kalvaro posted 3 years ago
Superb! Thanks a lot. I hadn't fully realised how much it hate backticks until they've vanished.
ansgar posted 3 years ago
Indeed. Well at least they made the backticks optionally.

Rapid-eraser posted 3 years ago
I kinda like backticks unhappy
Makes code more clear for me... I'll keep filling them my self :)
charlretief posted 3 years ago
I am with Rapid-eraser on this one. I write all my MySQL code with back-ticks in my MySQL sources. (As I have already stated in an earlier post).

I get it that alot of developers don`t like the back-ticks, but some of us do.

1) It makes it easier to read (for some of us)
2) and more robust vs future MySQL version updates that add new restricted keywords. How will you keep up with the new keywords introduced in v6 or 7 or 8 of MySQL [EX in MySQL 5.5 the following new words are now restricted (GENERAL; IGNORE_SERVER_IDS; MASTER_HEARTBEAT_PERIOD; MAXVALUE; RESIGNAL; SIGNAL; SLOW)]?
3) How about other servers like Percona or MariaDB that might add their own restricted keywords?

I am not saying this is a bad feature, but please make it configurable in the application preferences to always use back-ticks in sql.

charlretief posted 3 years ago
OK, sorry i was stupid with questions 2 and 3.
You probably just execute "SET SQL_QUOTE_SHOW_CREATE = 0;" in the background and let the server handle the necessary quoting.surprised

But my concerns are also for robustness vs future updates for the the 50000+ lines of sql code I have in stored routines. I don't take any chances with not having back-ticks in these routines for the reasons 2 and 3 states above.
ansgar posted 3 years ago
I broke the "copy columns" feature as I removed optional backticks in CREATE and ALTER tabs. ParseTableStructure requires backticks or doublequotes around column names. Not a problem until generated CREATE code was reused in that "copy columns" feature. I will revert r3938 so backticks in both tabs will reappear, to fix issue #2540.

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