Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format output is not a valid SQL #135

Closed
capaj opened this issue Mar 22, 2021 · 4 comments
Closed

format output is not a valid SQL #135

capaj opened this issue Mar 22, 2021 · 4 comments
Labels
Milestone

Comments

@capaj
Copy link

capaj commented Mar 22, 2021

Tested on "sql-formatter": "^4.0.2",

  console.log(
    format(
      `select "users".* from "users" where "users"."id" in where "certification_enrolments"."deleted_at" != 1)`
    )
  )

outputs

select
      "users".*
    from
      "users"
    where
      "users"."id" in
    where
      "certification_enrolments"."deleted_at" ! = 1
    )

expected output:

select
      "users".*
    from
      "users"
    where
      "users"."id" in
    where
      "certification_enrolments"."deleted_at" != 1
    )

the difference is there is not space between ! and =

@pankgeorg
Copy link

The same happens with the || operator (concatenation)

@ghenkhaus
Copy link

+1 We are seeing this issue as well with = > when the expected output is =>.

@inferrinizzard
Copy link
Collaborator

@nene
Copy link
Collaborator

nene commented May 3, 2022

Fixed now in master branch.

@nene nene closed this as completed May 3, 2022
@nene nene added this to the Version 6 milestone May 3, 2022
@nene nene added the bug label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants