john-kelly / elm-postgrest

Make PostgREST requests in Elm
109 stars 14 forks source link

from vs query vs (equiv) #50

Closed john-kelly closed 6 years ago

john-kelly commented 7 years ago
fetchSchools =
    PG.query Schema.school School
        |> PG.select .name
        |> PG.select .streetAddress
        |> PG.select .city
        |> PG.select .stateAbbrev
        |> PG.readMany "http://localhost:3000"
            { filter = []
            , order = []
            , limit = Nothing
            , offset = 0
            }

vs

fetchSchools =
    PG.from Schema.school School
        |> PG.select .name
        |> PG.select .streetAddress
        |> PG.select .city
        |> PG.select .stateAbbrev
        |> PG.readMany "http://localhost:3000"
            { filter = []
            , order = []
            , limit = Nothing
            , offset = 0
            }