john-kelly / elm-postgrest

Make PostgREST requests in Elm
109 stars 14 forks source link

`is` operator type #36

Closed john-kelly closed 6 years ago

john-kelly commented 7 years ago
{-| Is comparison
-}
is : Maybe Bool -> (schema -> Field (Maybe Bool)) -> schema -> Filter
is =
    singleValueFilterFn Is
john-kelly commented 7 years ago

https://www.postgresql.org/docs/9.1/static/functions-comparison.html

jbrgfx commented 6 years ago

Can you provide an example of a filter comparison on a Boolean?

I understand the postgresql reference, but I am struggling to implement the same using elm-postgREST. I can, however, use curl to return what I expect via the binary postgrest haskell directly using eq.true.

The utility of the package is really impressive.

jbrgfx commented 6 years ago

I succeeded using: . . . |> PG.is True ] or . . . |> PG.is False ]

The decoder does the work. Sorry for the confusion.

john-kelly commented 6 years ago

Glad you figured it out! Might I recommend taking a look at the dev version (on the dev branch)

Depending on the state of your project, it might make sense to use the upcoming version. I'm working on the release. It's ready for alpha if you're interested

jbrgfx commented 6 years ago

Thanks for the heads-up re: the alpha dev branch. Again, thanks for doing this project as it removes a pain-point or three on some use cases.

On Tue, Feb 13, 2018 at 12:13 PM, John Kelly notifications@github.com wrote:

Glad you figured it out! Might I recommend taking a look at the dev version (on the dev branch)

Depending on the state of your project, it might make sense to use the upcoming version. I'm working on the release. It's ready for alpha if you're interested

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/john-kelly/elm-postgrest/issues/36#issuecomment-365354685, or mute the thread https://github.com/notifications/unsubscribe-auth/Ah5ojFK68s5hTj3DJwU7GCTaI7lHY03hks5tUdDLgaJpZM4MM2Am .