5 ms·
Is there something like a "standard" HTTP client library and also a SQL abstraction library in Haskell nowadays, that everyone is using? Similar to what 'reques
by rkrzr 10y ago
Is there something like a "standard" HTTP client library and also a SQL abstraction library in Haskell nowadays, that everyone is using?
Similar to what 'requests' and 'SQLAlchemy' are in Python?
I feel those would be the two libraries that I would probably miss the most when switching to Haskell for a project.
- platz 10y agowreq and persistent are probably the closest libs to what you've listed for python
- rtpg 10y agoPersistent is an ORM that doesnt support SQL stuff entirely. So replacement for SQLAlchemy ORM but not Core If you want to be at the same level of abstraction as SQLAlchemy Core, you'll want to try esquelito (a SQL DSL).
- platz 10y agoAh thanks, I wasn't familiar with that part of SQLAlchemy
- rkrzr 10y agoThanks for pointing this out. I would indeed be looking for a replacement for SQLAlchemy Core, since I usually avoid ORMs. Esqueleto looks like it would fit the bill, since it does offer composability of queries, automated migrations, and protection against SQL-injections.
- ethagnawl 10y agoHave a look at Haskell Toolbox: http://haskell-toolbox.com/ http://haskell-toolbox.com/
- tinco 10y agoWoops, I lost steam a little on that project. How did you find it?
- ethagnawl 10y agoThanks to positive experiences with The Ruby Toolbox and The Clojure Toolbox, I usually search for "X toolbox" whenever I start experimenting with a new language.
- rkrzr 10y agoI like the idea behind it, but it does indeed seem a little unfinished. Esp. the metric for top packages (most dependencies from other packages in this category) seems flawed, since some other apparently popular libraries mentioned in this thread, don't appear there at all (e.g. wreq, persistent or esqueleto). I think "#stars on Github" could be an interesting metric to add. Thanks for your effort in creating this site.
- moosingin3space 10y agoI've heard good things about Servant as an HTTP client library.
- platz 10y agoservant-client is nice but quite different from 'requests'. And i'd also argue it supports a more limited set of use-cases due to having to specify the endpoint as a Rest type api.
- danidiaz 10y agoServant can do HTTP but it's more of a library for REST APIs.
- leshow 10y agoServant is built on wai and warp and is more of a DSL for writing APIs. It's a fantastic framework, but it's not an 'http client library' as such.
- leshow 10y agowai and warp are the haskell packages that pretty much every haskell webserver framework are built on. they are very battle-tested and mature
- mightybyte 10y agoGroundhog (http://hackage.haskell.org/package/groundhog http://hackage.haskell.org/package/groundhog) is a nice "ORM" for Haskell. If you need something more flexible you can drop down and write raw SQL with postgresql-simple (http://hackage.haskell.org/package/postgresql-simple http://hackage.haskell.org/package/postgresql-simple). There's also a corresponding mysql-simple package. There are several HTTP clients: http-streams (http://hackage.haskell.org/package/http-streams http://hackage.haskell.org/package/http-streams) http-conduit (http://hackage.haskell.org/package/http-conduit http://hackage.haskell.org/package/http-conduit) wreq (http://hackage.haskell.org/package/wreq http://hackage.haskell.org/package/wreq)
- marcosdumay 10y agoI'll second the groundhog suggestion. It is much more flexible than persistent. If you are not doing an yesod project (for what persistent is the standard), you should think about using it.
- codygman 10y agoI also want to say wreq for http and persistent/esqueleto for SQL alchemy equivalent.