Explicitly positive integer in Google Cloud Datastore

85 views Asked by At

I was studing the Google Cloud Datastore GQL grammar and behavior when I found the "explicity positive integer" concept. Someone could tell me an example of its usability? I think that with an example I could understand better the importance and use of this type.

Thanks in advance!

1

There are 1 answers

0
Patrick Costello On BEST ANSWER

The explicitly positive integer concept is something taken from SQL. Here is a link from the Oracle SQL database docs since it includes a nice infographic, but you can also check out the SQL paper (1992) and search for "<signed integer literal>".

The main reason this exists is just for completeness, in your normal use of GQL it is ok to just leave the operator off to specify a positive number.

My best guess as to when you would actually use this is if you were building a GQL string and found it useful to add a modifier regardless of if a number is positive or negative.