在Go中的数据存储读取策略设置

huangapple go评论87阅读模式
英文:

Datastore read policy setting in Go

问题

在Google App Engine中,我正在尝试使用Go设置Datastore的读取策略。

Python可以使用read_policy = db.EVENTUAL_CONSISTENCY来实现,但是似乎没有Go的等效方法。你可以看到Go文档中缺少了这一部分。

https://developers.google.com/appengine/docs/python/datastore/queries#Python_Data_consistency
https://developers.google.com/appengine/docs/go/datastore/queries#Go_Data_consistency

有人可以帮忙吗?

英文:

In Google App Engine I'm trying to set the Datastore read policy using Go.

Python has this ability using read_policy = db.EVENTUAL_CONSISTENCY but there seems to be no Go equivalent. You can see that this section is missing from the Go documentation.

https://developers.google.com/appengine/docs/python/datastore/queries#Python_Data_consistency
https://developers.google.com/appengine/docs/go/datastore/queries#Go_Data_consistency

Can anyone help?

答案1

得分: 1

这个功能现在已经添加了。

https://developers.google.com/appengine/docs/go/datastore/reference#Query.EventualConsistency

英文:

This functionality has now been added.

https://developers.google.com/appengine/docs/go/datastore/reference#Query.EventualConsistency

答案2

得分: 0

是的,目前似乎没有办法为祖先查询指定“最终一致性”(其他类型的查询始终是强一致性或最终一致性)。

您可以在https://code.google.com/p/googleappengine/issues/entry?template=Feature%20request上创建一个新问题。

如果您创建了一个问题,请在这里发布ID,以便其他人可以给它加星。

英文:

Yeah, it seems there's currently no way to specify eventual consistency for ancestor queries (other kinds of queries are always either strong or eventually consistent).

You could create a new issue on https://code.google.com/p/googleappengine/issues/entry?template=Feature%20request

If you do create one, please post here the ID so that others can star it.

huangapple
  • 本文由 发表于 2014年4月16日 17:54:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/23105956.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定