GAE Datastore --property values (data types you can store)
Data Type |
Java type |
Python type |
Unicode text string (up to
|
java.lang.String |
unicode or str (converted to uni |
Long Unicode text string
|
datastore.Text |
db.Text |
Short byte string (up to |
datastore.ShortBlob |
db.ByteString |
Long byte string (not indexed) |
datastore.Blob |
db.Blob |
Boolean |
boolean or java.lang.Boolean |
bool |
Integer (64-bit) |
byte, short, int, or long (converted to long) |
int or long (converted to 64-bit long) |
Float (double precision) |
float or double (converted to double) |
float |
Date-time |
java.util.Date |
datetime.datetime |
Null value |
null |
None |
Entity key |
datastore.Key |
db.Key |
A Google account |
...api.users.User |
users.User |
A category (GD) |
datastore.Category |
db.Category |
A URL (GD) |
datastore.Link |
db.Link |
An email address (GD) |
datastore.Email |
db.Email |
A geographical point |
datastore.GeoPt |
db.GeoPt |
An instant messaging |
datastore.IMHandle |
db.IM |
A phone number (GD) |
datastore.PhoneNumber |
db.PhoneNumber |
A postal address (GD) |
datastore.PostalAddress |
db.PostalAddress |
A user rating (GD) |
datastore.Rating |
db.Rating |
A Blobstore key |
blobstore.BlobKey |
ext.blobstore.BlobKey |
Package Names in JAVA only for selected data types above
NOTE: GD = Google Data protocol -- distinctive GAE native data types in datastore
NOTE: GeoPt is a pair of floating-point values for latitude (–90 to +90) and longitude (–180 to +180),
NOTE: Rating is an integer between 1 and 100.
NOTE: Blobstore keys refer to values in the Blobstore. (covered in Chpater 10 of your book --do as desired on your own --not covered in class)
Strings -- 2 kinds
Short Strings
- indexed ( can be subject of queries ---- searching every Person entity for last_name property)
- < 500 bytes (see api for latest value)
Long Strings
- NOT indexed ( can NOT be subject of queries !!!!)
- can be > 500 bytes (se
Uses UTF-8 encoding
- some characters using multiple bytes.
- means that the 500-byte limit for short strings is not necessarily the same as 500 Unicode characters.
.
Blobs and Blobstore (THIS IS DIFFERENT SERVICE THAN DATASTORE!!!!)
-
Data of No format
-
Bytes are preserved
-
Good for images, movies, media
-
Indexed (Short Blob) or Non Indexed (Blob) variety
-
IN JAVA: the blob types are datastore.ShortBlob and datastore.Blob