john-kelly / elm-postgrest

Make PostgREST requests in Elm
109 stars 14 forks source link

Condition vs Filter #53

Closed john-kelly closed 6 years ago

john-kelly commented 7 years ago

important to note that with the addition of or operators https://github.com/john-kelly/elm-postgrest/issues/44 -- it makes sense for an overhaul of the api.

it's likely that we want Condition to have an api like:

and : Condition -> Condition -> Condition
or : Condition -> Condition -> Condition 

-- maybe even with some fancy infix stuff (not sold on this yet)
|&| : Condition -> Condition -> Condition
||| : Condition -> Condition -> Condition 

-- maybe even something a bit more interesting
-- not sure if i love these not being binary tho. maybe different names? 
-- allOf and oneOf seem pretty nice... the only issue being that i was thinking Selection
-- would have a oneOf in order to support tagged unions... a module namespace could solved this
-- but i think it's important to note the trade offs here.
and : List Condition -> Condition
or : List Condition -> Condition