Good question. Thanks!
sqlite-simple has more capabilities (for example streaming results) than sqlite-easy and is much more battle-tested, but is a bit more complicated to work with and imo a bit less ergonomic. Specifically:
- sqlite-easy does not use typeclasses. No
ToRow
orFromField
or other. It usesSQLData
instead to encode possible database values and leaves the encoding/decoding to the user. I find this to be easier to work with and it does not require type annotations. - sqlite-easy uses the
SQLite
type instead ofConnection -> IO
. This means that we don’t need to thread through theConnection
, and it makes working with transactions a bit easier I think. - As you mentioned, sqlite-easy comes with simple
resource-pool
out of the box, so if you’re not sure what you’re doing or need something quick, this is pretty handy. - sqlite-easy comes with migrations support (via migrant) out of the box. If you know what you’re doing you will find
migrant-sqlite-simple
or other solutions, and you’ll figure out how to use it yourself. sqlite-easy caters to people that want a documented solution out of the box. - sqlite-easy’s dependency footprint is a bit smaller than sqlite-simple’s, but not by much.
All in all, if you are a Haskell veteran that knows how to figure stuff out yourself, and you want a more featureful, battle-tested library, you might want to use sqlite-simple
. If you don’t have as much experience and want to just follow a manual to get your toy project working, and you are fine with using a more restricted, experimental library, starting with sqlite-easy
might be easier.