You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently gae has 'special' metadata fields which can be of type *Key. However, there's no way to synthesize a *Key correctly without also having the AppID and Namespace strings. Either you can use the datatstore.Interface.MakeKey method (which takes them from the context), or you can use the datastore.MakeKey, which requires them to be passed in.
I would prefer to pass these strings in the Get* functions, rather than passing the context. If we pass the context then there's a risk that MetaGetter implementations could do naughty things like talk to the datastore, or potentially even deadlock (by calling other MetaGetter types, which are non-obviously mutually recursive). Passing the (aid, ns) context explicitly doesn't have this risk, and it makes it obvious what this contextual information should be used for.
The text was updated successfully, but these errors were encountered:
Yes. Introduction of KeyContext gives us a key generation struct that can do all of that without access to Context. You can generate a KeyContext from a Context or manually via MkKeyContext.
The MetaGetterSetter interface doesn't know how to take advantage of KeyContext though; however, MGS also doesn't take a Context argument, so I'm not sure what the latter half of the first comment is referring to.
Currently gae has 'special' metadata fields which can be of type *Key. However, there's no way to synthesize a *Key correctly without also having the AppID and Namespace strings. Either you can use the
datatstore.Interface.MakeKey
method (which takes them from the context), or you can use thedatastore.MakeKey
, which requires them to be passed in.I would prefer to pass these strings in the Get* functions, rather than passing the context. If we pass the context then there's a risk that MetaGetter implementations could do naughty things like talk to the datastore, or potentially even deadlock (by calling other MetaGetter types, which are non-obviously mutually recursive). Passing the (aid, ns) context explicitly doesn't have this risk, and it makes it obvious what this contextual information should be used for.
The text was updated successfully, but these errors were encountered: