Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Postgresql-simple is a great library, it makes a nice use of overloaded strings to do the job. Some other nice libraries to keep an eye on are opaleye (postgres specific, which is equally nice but could be a bit difficult to get why the types are so big) and a combination of persistent (not DB specific! can work on postgres, sqlite, but also noSQL DBs like mongo, it's still easy to learn but you lose some things, such as joins due to the power of being agnostic) + esqueleto for type safe joins (be sure to look up the experimental package, it's a more comfortable syntax that will soon become the default one).
I wanted something simple for my pet project, and I loved working with sqlite-simple. But I decided to wrap it into ReaderT, so I wouldn't have to pass connection everywhere. Like this: https://github.com/sudo97/bayes-hs/blob/main/src/DBWork.hs
If you need Cassandra specifically, cql-io is pretty good. For a general purpose database I'd go with Postgres. There are many good choices in the Haskell ecosystem, but I really like postgres-typed. It lets you write plain SQL, checks you queries against a live database schema at compile time, and makes sure you use the results correctly as well. It's amazing, I never ran into type related errors and it's pretty seamless.