Hi all,

in trunk is an update and modification to the projection queries.  because 
of the extra index potentially needed to run a projection query i updated 
select on GAE to take an optional attribute 'withprojection' which is a 
boolean, when True i attempt a projection query.

i also implemented Anthony's suggestion about the ID field name, and when 
withprojection is True i do check for obvious errors (equality filters of a 
projection field, text and blob field types).

so now if you want a projection query you would write something like:

  db(db.store.id>0).select(db.store.name, withprojection=True)

please let us know if you have problems or further suggestions!

christian

On Tuesday, June 12, 2012 12:10:34 PM UTC-7, Anthony wrote:
>
> should projection queries be automatic on GAE, or should there be a select 
>> attribute that specifies that i want a projection query?  how hard should 
>> web2py work to check the validity of said query before sending to GAE? 
>>
>
> If projection queries are automatic, then the code has to do a really good 
> job of recognizing valid projection queries and reverting to standard 
> queries when a projection won't work (rather than raising an exception or 
> returning no records). Otherwise, projections queries should just be an 
> option (not the default), and we can leave it up to the developer to ensure 
> the query is a valid one.
>
> Anthony
>

Reply via email to