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
