apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: apr_dbd: supporting multiple selects + results sets
Date Mon, 14 May 2007 23:54:42 GMT
On Tue, 2007-05-15 at 00:23 +0100, Nick Kew wrote:
> Anyone care to draft
> and propose an API extension for it?

I guess the simplest thing to do would be to keep the API as is.

For _[pb]query functions, nrows passed in can be a pointer to an array,
which has the size of the number of queries, user allocated. Current
situation would be a special case where nrows[0] is actually *nrows
inside the function.

For _[pb]select functions, we're making our own result (i.e. allocating
it) and we can use the same trickery there - just have an array of
pointers instead of one. Parsing queries to find out how many queries
there is, is a bad idea, so internally we can have a linked list of
results, which we traverse in the end and store pointers to each
individual result set into the array of pointers we allocate for that
purpose, which is what the users see.

Users can then, based on their knowledge of number of queries passed in,
determine what to do with the stuff they got back (i.e. have a for loop
where they use all/any of them they like).

-- 
Bojan


Mime
View raw message