开发者

Parameterized queries in Google App Engine Datastore?

开发者 https://www.devze.com 2023-01-29 15:00 出处:网络
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 co

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消