Construct postgrest queries in elm
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Postgrest
tests
.gitignore
.travis.yml
LICENSE
README.md
elm.json

README.md

alex-tan/postgrest-queries

Build Status

Easily construct Postgrest queries using Elm.

import Postgrest.Queries as P

[ P.select
  [ P.attribute "id"
  , P.attribute "name"
  , P.resourceWithParams "children"
    [ P.order [P.asc "name"] ]
    [ P.attribute "id"
    , P.attribute "name"
    ] 
  ]
]
|> P.toQueryString
-- select=id,name,children(id,name)&children.order=name.asc

queryParams : String
queryParams =
  [ P.limit 10
  , P.order [ P.asc "foo_level" ]
  ]
  |> P.toQueryString
  -- limit=10&order=foo_level.asc