Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppEngine: restrictions on the Datastore Entities `kind` value?

When creating Entities with low-level API on AppEngine's Datastore, one must provide the kind of the Entity, e.g.

Entity newEntity = new Entity("SomeEntityKind", id);

Docs are here, but they do not explain anything about restrictions on kind. I also checked AppEngine Python docs, but they do not jave low-level Entities API (and Key does not list any restrictions on kind).

Are there any restrictions on the format of the kind? Can it contain whitespace characters? Other special characters? Any length limit?

Does anyone have more info about this?

like image 393
Peter Knego Avatar asked Oct 13 '11 16:10

Peter Knego


1 Answers

Yeah, that's underspecified. I'll see about getting that fixed.

Basically, if you stick with names that can derived from class names, you'll be fine. Don't use leading double underscores. I'll check into specific limits later, and will update this.

Update: 500 chars max, beginning and ending with double underscores is reserved. Don't embed newlines. Unicode might get you in to trouble with parts of the SDKs that don't expect it. Basically, stick with Kind names that can be derived from class names, and you'll be fine.

like image 54
Dave W. Smith Avatar answered Sep 28 '22 00:09

Dave W. Smith