[Haskell-cafe] ANNOUNCE: HaskellDB 2.0: Scrap your SQL strings

Christopher Done chrisdone at googlemail.com
Wed Feb 22 14:34:44 CET 2012

On 21 February 2012 11:51, Mats Rauhala <mats.rauhala at gmail.com> wrote:
> You mentioned that haskelldb was the first library where you weren't
> forced to break the abstraction. Do you have a solution to a situation
> where you might want to retrieve the last inserted id after an insert?

That's a case where I would consider modifying
haskelldb-hdbc-postgresql, for example, to export an insertReturningId
or whatever, because some other engines don't support returning an ID,
and it wouldn't make sense to return Maybe Int or error for the ones
that don't support it. This way it's well-typed.

More information about the Haskell-Cafe mailing list