Skip to content

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

@xingorg1

Description

@xingorg1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions