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.

API Trace View

Struggling with slow API calls?

Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay