sql-formatter
sql-formatter copied to clipboard
A syntax error occurs in SQL formatting when sql code has '!=' operator
When sql code has "!= "operator, formatting code gets wrong syntax formatting"! = ". There is an extra space between the "!" symbol and the "=" symbol
for example:
SELECT
*
FROM
tableName
WHERE
dt = '2021-11-09'
AND some != '111'
i‘ll get it
SELECT
*
FROM
tableName
WHERE
dt = '2021-11-09'
AND some ! = '111'
Here's how I use it:
import { format as sqlFormatter } from "sql-formatter";
let newVal = "SELECT * FROM tableName WHERE dt='2021-06-09' AND some != '111'"
sqlFormatter(newVal);
[email protected] browser:Chrome@latest