This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
PostgREST Query Builder
version 4.1.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 4.1.0
Committed At 2017-02-27 08:12:41 UTC
elm-lang/http 1.0.0 <= v < 2.0.0 1.0.0
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1

Modules

README

elm-postgrest

Build Status

A query builder library for PostgREST.

Example

import PostgRest as PG

type PokemonResource
    = PokemonResource

pokemonResource =
    PG.resource PokemonResource
        "pokemon"
        { id = PG.int "id"
        , name = PG.string "name"
        , base_experience = PG.int "base_experience"
        , weight = PG.int "weight"
        , height = PG.int "height"
        }

type alias Pokemon =
    { id : Int
    , name : String
    }

pokemonRequest =
    PG.query pokemonResource Pokemon
        |> PG.select .id
        |> PG.select .name
        |> PG.filter [ .id |> PG.lte 151 ]
        |> PG.order [ PG.asc .id ]
        |> PG.list PG.noLimit "http://localhost:8000/"