# Sqlite-easy: A primitive yet easy to use sqlite library

**URL:** <https://discourse.haskell.org/t/sqlite-easy-a-primitive-yet-easy-to-use-sqlite-library/5315>\
**Category:** Show and Tell\
**Created:** [November 16, 2022, 4:48pm UTC](https://discourse.haskell.org/t/sqlite-easy-a-primitive-yet-easy-to-use-sqlite-library/5315 "2022-11-16T16:48:41Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![gilmi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/gilmi/32/45_2.png) [@gilmi](https://discourse.haskell.org/u/gilmi)\
**Post date:** [November 21, 2022, 12:39pm UTC](https://discourse.haskell.org/t/sqlite-easy-a-primitive-yet-easy-to-use-sqlite-library/5315/3 "2022-11-21T12:39:50Z")

</div>

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` or `FromField` or other. It uses `SQLData` 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 of `Connection -> IO`. This means that we don’t need to thread through the `Connection`, 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.

---

_[View the full topic](https://discourse.haskell.org/t/sqlite-easy-a-primitive-yet-easy-to-use-sqlite-library/5315)._
