purcell / sqlint

Simple SQL linter supporting ANSI and PostgreSQL syntaxes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backticks are considered a syntax error

mikedfunk opened this issue · comments

e.g.

SELECT * FROM `my_table`

You didn't say what database you're using, but backticks are not ANSI-compliant. I'm guessing you're using MySQL, in which case I imagine you could instead use the standard double-quotes.

(In MySQL you can apparently use SET sql_mode = 'ANSI_QUOTES'; to get standards-compliant behaviour.)

Sorry, yes, MySQL. I always thought backticks were preferred in order to avoid problems with reserved words, kind of like double-quoting variables in bash. I didn't realize it was not standards-compliant.

Could be a possibility of ignoring backticks as a syntax error if passing a specific parameter?