On Friday, December 05, 2014 12:22:38 PM Heikki Linnakangas wrote:
> Oh, that's what the PQgetLastQuery/PQgetNextQuery functions work! I
> didn't understand that before. I'd suggest renaming them to something
> like PQgetSentQuery() and PQgetResultQuery(). The first/last/next names
> made me think that they're used to iterate a list of queries, but in
> fact they're supposed to be used at very different stages.
>
> - Heikki
Okay, I have renamed them with your suggestions, and added
PQsetPipelining/PQgetPipelining, defaulting to pipelining off. There should be
no behavior change unless pipelining is enabled.
Documentation should be mostly complete except the possible addition of an
example and maybe a general pipelining overview paragraph.
I have implemented async query support (that takes advantage of pipelining) in
Qt, along with a couple test cases. This led to me discovering a bug with my
last patch where a PGquery object could be reused twice in a row. I have fixed
that. I contemplated not reusing the PGquery objects at all, but that
wouldn't solve the problem because it's very possible that malloc will return
a recent free of the same size anyway. Making the guarantee that a PGquery
won't be reused twice in a row should be sufficient, and the only alternative is
to add a unique id, but that will add further complexity that I don't think is
warranted.
Feedback is very welcome and appreciated.
Thanks,
Matt Newell