bitemyapp / esqueleto

New home of Esqueleto, please file issues so we can get things caught up!
BSD 3-Clause "New" or "Revised" License
376 stars 108 forks source link

`not_` is broken #359

Open goosedb opened 1 year ago

goosedb commented 1 year ago
share [mkPersist sqlSettings] [persistLowerCase|
  Person
    name String
    age Int
    deriving Eq Show
|]

query :: SqlPersistM [Entity Person]
query = select $ from \(person :: SqlExpr (Entity Person)) -> do
  where_ $ not_ (person.name !=. val "foo" &&. person.age >. val @Int 15)
  pure person

produces

SELECT "person"."id", "person"."name", "person"."age" FROM "person" WHERE NOT ("person"."name" != ?) AND ("person"."age" > ?); 

expected

SELECT "person"."id", "person"."name", "person"."age" FROM "person" WHERE NOT (("person"."name" != ?) AND ("person"."age" > ?));