Parameterized queries in Google App Engine Datastore?
The GAE Datastore provides a class PreparedQuery
, which is the compiled form of a query. But is there such a thing as a parameterized query (e.g. lastname = {?}
)开发者_运维技巧 ? There’s no point in compiling a query if it needs to be recompiled every time a parameter changes (unless the same exact query is run over and over again, in which case its results should be cached, anyway).
Did I overlook something in the documentation?
No, there isn't - parameters are specified when you construct the Query object. 'Preparing' a query is not an expensive operation, however - no datastore roundtrips are involved.
精彩评论