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

not_ is broken #359

Open
goosedb opened this issue Apr 24, 2023 · 0 comments · May be fixed by #379
Open

not_ is broken #359

goosedb opened this issue Apr 24, 2023 · 0 comments · May be fixed by #379

Comments

@goosedb
Copy link

goosedb commented Apr 24, 2023

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" > ?)); 
@blujupiter32 blujupiter32 linked a pull request Sep 29, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant