Selda: A Haskell SQL Library

What is Selda?

Selda is an EDSL — an embedded domain-specific language — for defining, querying and modifying relational databases from Haskell. The same type-safe Selda query can be executed unmodified on either PostgreSQL or SQLite, making Selda ideal for prototyping as well as for taking the step from prototype to real application.

Through its monadic interface, Selda supports writing queries in a linear, natural style. The generated SQL code is guaranteed to be correct, type-safe and executable on all supported backends. With a minimalist approach to dependencies, Selda is lightweight enough to be suitable for inclusion in libraries as well as full applications. All non-essential features are optional, either through configuration flags or through separate add-on packages.