> > for a standard database (eg postgres) "belongs" would be faster,
> > right? Because I am using this same code for both GAE and a Linux box.
>
> Yes a relational database can do this in 1 query, GAE would require N
> queries or 1 batch get by id.
exactly. To get optimized code on both platforms I currently need to
use:
if request.env.web2py_runtime_gae:
records = [db.test[id] for id in test_ids]
else:
records = db(db.test.id.belongs(test_ids)).select()
So what I am suggesting is the DAL support "belongs" for GAE by doing
this behind the scenes, to make web2py apps more backend agnostic.
> > insert/update is already supported on GAE, so what would get/put add?
>
> Using batch get/put/delete would allow selecting, inserting/updating,
> and deleting of multiple records (up to 500) with a single database
> request rather than 500 requests.
Neat. But multiple record get/update/delete are already supported. And
I guess multiple record insert wouldn't fit with the current API.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---