Hey everyone. I’ve been working on an elm client for the backend technology PostgREST. Even if you don’t care about PostgREST, I think that you’ll find the post interesting. The post talks about both:
the core abstractions found in the elm-postgrest package and how those abstractions may be relevant to similar packages
In the beginning of the post, I spend a bit of time going over my understanding of the design space of Remote Data Request APIs in Elm. I hope this overview is helpful to anyone designing APIs in this space. Here’s a diagram from the post to preview some of the ideas:
| Request Builder |
Schema Description |
CRUD requests selections conditions order limit and offset pagination |
resource schema attributes relationships cardinality |
|
| Abstraction Barrier |
|
| Transfer Protocol |
Interchange Format |
HTTP: headers body methods url: query and fragment status codes |
json edn xml transit protobuf |
In addition to the post, I forked Richard Feldman’s elm-spa-example to exemplify the use of elm-postgrest. Here’s a link to that: john-kelly/elm-postgrest-spa-example. In that repo, I wrote a custom PostgREST backend and re-implemented Richard’s Request module with john-kelly/elm-postgrest.
I’m still actively developing john-kelly/elm-postgrest, so if you’re curious, checkout out the dev branch.
Thanks for your time everyone.