eslint-plugin-sql icon indicating copy to clipboard operation
eslint-plugin-sql copied to clipboard

allow to supply custom isSqlQuery helper or use better library

Open dwelle opened this issue 7 years ago • 3 comments

Toying with the plugin, I'm coming across valid SQL queries that aren't recognized, such as:

SELECT * FROM article a WHERE NOT a.archived

-- or

SELECT * FROM article a WHERE (a.authz & 8)::bool

One solution would be to either allow users to supply their own SQL parser (though I haven't checked if eslint allows to pass functions as settings values in .eslintrc.js), or replace the sql-parse, which seems unmaintained, with something else.

dwelle avatar Sep 01 '18 20:09 dwelle

Maybe sql-surveyor would be an alternative for a parser?

karlhorky avatar Nov 19 '20 19:11 karlhorky

Maybe sql-surveyor would be an alternative for a parser?

Seems to be not maintained anymore.

gajus avatar Nov 17 '22 17:11 gajus

maybe some sql-ast-parsers or it slow? https://www.npmjs.com/package/pgsql-ast-parser https://www.npmjs.com/package/node-sql-parser

npdev453 avatar Jul 28 '23 19:07 npdev453