lpsmith/postgresql-simple — comment on commit efb67bac17887a8db7416f54745a2f1af56a033b
File:  line 0
By lpsmith:

Ok, this kind use of `Internal` I'm not immediately concerned about.
I did clean up your code a little bit
[here](https://github.com/lpsmith/persistent/commit/c28937aeba5f2874bea2e545219e5da35aa388b5);
the use of withConnection would have avoided the breakage. ;-)
However, there are a few things to point out:

1. Beyond the process running persistent, this isn't really a
"streaming" interface; exec blocks until the PostgreSQL backend is
finished returning results.

2. I have attempted some approximation of a streaming interface
[here](https://github.com/lpsmith/postgresql-simple/commit/bce0d389fd16a35a88841bb8434fab264b824993),
note the caveats (although judging from your code they don't apply
to you)

3. Your second point might be an interesting one.

On Mon, Jan 9, 2012 at 11:51 AM, Felipe Lessa

wrote:
> Please take a look at https://github.com/meteficha/persistent/blob/postgresql-simple/persistent-postgresql/Database/Persist/Postgresql.hs#L106 .
>
> I'm doing it mainly because `postgresql-simple`:
>
> 1. Doesn't provide a streaming interface for the results, only a list interface.
>
> 2. Wants to statically know the type of the result. While I could create something like `newtype Row = Row [PersistValue]` and give it a `QueryResults` instance, I'd need to parse `typename` for all columns of every row. I think that this could be solved if you used `convertResults` partially applied, that is `convert = convertResults fields`, allowing me to do something like `convertResults fields = let ... in \vals -> ...`.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/lpsmith/postgresql-simple/commit/efb67bac17887a8db7416f54745a2f1af56a033b#commitcomment-850098