is it possible to "refine" an existing QofQuery multiple times?
Derek Atkins
warlord at MIT.EDU
Wed Sep 27 08:37:01 EDT 2006
I implemented this in r14901. Enjoy.
Christian Stimming <stimming at tuhh.de> writes:
> Derek,
>
> by the way, this "enhancement request" to the QOF API is still valid. I'd love
> if a subquery on a qof query were implemented, because then I'd subsequently
> be able to speed up the generic importer (hopefully) quite a lot.
>
> Is it possible for you sometime in the future to implement what you've
> outlined? Thanks a lot in advance.
>
> Christian
>
> Am Sonntag, 6. August 2006 16:20 schrieb Derek Atkins:
>> No, there's no way to take the results of a query and run a subquery on it.
>> HOWEVER, I think adding that functionality might be pretty easy. We could
>> add something like:
>>
>> GList* qof_query_run_subquery(QofQuery* subq, QofQuery* q);
>>
>> Note that running qof_query_run() on the same query multiple times will
>> re-iterate over the full book, but you can use qof_query_last_run()
>> to just return the last set.
>>
>> I think adding this new API would be relatively simple.
>> What you've provided below will still iterate multiple times. Using
>> this new API you'd do something like:
>>
>> ...
>> [ setup query ]
>> ...
>> (void)qof_query_run(stored_query);
>> ...
>> loop {
>> ...
>> [ setup subquery ]
>> results = qof_query_run_subquery(subq, stored_q);
>> ...
>> }
>>
>> -derek
>>
>> Quoting Christian Stimming <stimming at tuhh.de>:
>> > Just a question about the qofquery.h interface: Is it possible to refine
>> > a query multiple times?
>
>
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel
mailing list