Closed theetrain closed 1 year ago
That's working as intended. Backticks inside double quotes are command substitutions. So evaluating that field is actually calling the program School
with the argument Name
. You likely want single quotes, which do not perform expansions.
Thanks for the information. You're right, replacing double quotes with single quotes no longer formats strings; this works for me.
-dolt sql -q "ALTER TABLE schools ADD primary key(`School Name`);"
+dolt sql -q 'ALTER TABLE schools ADD primary key(`School Name`);'
This is mostly a general question on how to disable formatting for a file since I cannot find it in the README. I have a shell file that performs inline MySQL queries, but sh converts backticks to
$()
that breaks SQL statements. Here's a real example:But sh converts the backticks in the SQL line to the following invalid line:
I'm not an advanced shell user, but I would hope that backticks inside double-quoted strings would be respected.
I've seen related issues about how there is no feature for disabling a single line or group of lines. See #342, #700.
I use the shell-format VSCode extension. My workaround is to save without formatting, in VSCode it's typically ⌘+K,S.