DEV Community

Zelenya
Zelenya

Posted on

Okay, so which PostgreSQL library should I use with Haskell?

I can’t tell you which library to use. I don’t know myself. But I can tell you the questions you (and your team) should consider:

  • Do you want to write raw sql queries? or query builder? or use some sort of ORM? Do you want to learn a new DSL?
  • How type-safe do you want to be? How readable/optimizable the generated queries should be?
  • Do you need bells and whistles, like built-in connection pools or migrations?
  • How comfortable are you with Haskell and type-level? Is this something you can afford?
  • Do you need to be database agnostic?

Also, this is just the tip of the iceberg; we haven’t discussed specific features, performance, compilation speed… And spoiler alert: generics, template haskell, and type-families don’t come for free.

We aren’t really at the point where people care to compare the performance. But you don’t know unless you measure. Feel free to explore and get some community karma.

Another excellent contribution opportunity is documentation and tutorials, especially if you have a favorite library and want to convince others to consider it.

Top comments (0)