jdorn/sql-formatter

A syntax error occurs in SQL formatting when sql code has '!=' operator

Opened this issue · 0 comments

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);

sql-formatter@4.0.2
browser:Chrome@latest