Closed john-kelly closed 7 years ago
reason being -- include is currently forced to be Maybe... because of the possibility of filtering the query
include
something like this.
sessionCmd = let speakerQuery = PG.query Resources.speaker Speaker |> PG.select .id |> PG.select .name |> PG.select .bio in PG.query Resources.session Session |> PG.select .id |> PG.select .location |> PG.select .start_time |> PG.include .speaker speakerQuery |> PG.list "http://postgrest.herokuapp.com/" [ .location |> PG.not PG.ilike "%russia%" ] [ PG.asc .start_time ] PG.noLimit |> Http.send Fetch vs sessionCmd = let speakerQuery = PG.query Resources.speaker Speaker |> PG.select .id |> PG.select .name |> PG.select .bio in PG.query Resources.session Session |> PG.select .id |> PG.select .location |> PG.select .start_time |> PG.include .speaker speakerQuery |> PG.list "http://postgrest.herokuapp.com/" { filter = [ .location |> PG.not PG.ilike "%russia%" ] , order = [ PG.asc .start_time ] , limit = PG.noLimit } |> Http.send Fetch
includeMany, paginate, first, list all need to be changed + we need to add includeNullable (with accompanying Phantom types)
reason being --
include
is currently forced to be Maybe... because of the possibility of filtering the querysomething like this.