[aur-dev] [RFC] aurjson: add result count to JSON result

Dan McGee dpmcgee at gmail.com
Wed Nov 2 16:36:27 EDT 2011


On Wed, Nov 2, 2011 at 3:17 PM, Lukas Fleischer
<archlinux at cryptocrack.de> wrote:
> On Tue, Oct 25, 2011 at 06:39:52PM -0400, Dave Reisner wrote:
>> We already ask for the result count, but only use it as a basis for testing
>> query success or failure. Add the value to the JSON reply.
>>
>> Signed-off-by: Dave Reisner <dreisner at archlinux.org>
>> ---
>> I call this an RFC because:
>>
>> a) I don't have a test environment setup
>> b) I don't know PHP
>>
>> ...but I really like the idea of knowing ahead of time how many results you're
>> about to receive.
>
> Just tested it, seems to work! Looks fine to me, also :)
>
> Is there any use case for this yet? Just out of curiosity...

Obviously you shouldn't treat the number as gospel and ensure you
don't overflow, but if you want to preallocate space or something like
that for the result it might be useful.

-Dan


More information about the aur-dev mailing list