
On Tue, Dec 30, 2014 at 04:59:29PM -0800, info@rotnetix.com wrote:
That might be tricky... See https://github.com/lpsmith/postgresql-simple/pull/115, it seems like it is not trivial to get the conversions to haskell types correct.
Look like I am back to native SQL for that one.
As lpsmith says here https://github.com/lpsmith/postgresql-simple/pull/115#issuecomment-48754627 you can use the attached patch in your own code to get a conversion from `interval` to `DiffTime`. It will have a few strange corner cases but you will probably find you never hit them. Once you've done that you can make them suitable for Opaleye by writing data PGInterval instance QueryRunnerColumnDefault PGInterval DiffTime where queryRunnerColumnDefault = fieldQueryRunnerColumn (you may have to import something from Opaleye.Internal.RunQuery). Please let me know how you get on with that, if you try it. Tom