thirdparty/google_appengine/google/appengine/ext/gql/__init__.py
changeset 2864 2e0b0af889be
parent 2413 d0b7dac5325c
child 3031 7678f72140e6
equal deleted inserted replaced
2862:27971a13089f 2864:2e0b0af889be
    75   - reserved words are case insensitive
    75   - reserved words are case insensitive
    76   - names are case sensitive
    76   - names are case sensitive
    77 
    77 
    78   The syntax for SELECT is fairly straightforward:
    78   The syntax for SELECT is fairly straightforward:
    79 
    79 
    80   SELECT [* | __key__ ] FROM <entity>
    80   SELECT [* | __key__ ] [FROM <entity>]
    81     [WHERE <condition> [AND <condition> ...]]
    81     [WHERE <condition> [AND <condition> ...]]
    82     [ORDER BY <property> [ASC | DESC] [, <property> [ASC | DESC] ...]]
    82     [ORDER BY <property> [ASC | DESC] [, <property> [ASC | DESC] ...]]
    83     [LIMIT [<offset>,]<count>]
    83     [LIMIT [<offset>,]<count>]
    84     [OFFSET <offset>]
    84     [OFFSET <offset>]
    85     [HINT (ORDER_FIRST | HINT FILTER_FIRST | HINT ANCESTOR_FIRST)]
    85     [HINT (ORDER_FIRST | HINT FILTER_FIRST | HINT ANCESTOR_FIRST)]
   803     Transitions to a WHERE clause.
   803     Transitions to a WHERE clause.
   804 
   804 
   805     Returns:
   805     Returns:
   806       True if parsing completed okay.
   806       True if parsing completed okay.
   807     """
   807     """
   808     self.__Expect('FROM')
   808     if self.__Accept('FROM'):
   809     entity = self.__AcceptRegex(self.__identifier_regex)
   809       kind = self.__AcceptRegex(self.__identifier_regex)
   810     if entity:
   810       if kind:
   811       self._entity = entity
   811         self._entity = kind
   812       return self.__Where()
   812       else:
   813     else:
   813         self.__Error('Identifier Expected')
   814       self.__Error('Identifier Expected')
   814         return False
   815       return False
   815     else:
       
   816       self._entity = None
       
   817     return self.__Where()
   816 
   818 
   817   def __Where(self):
   819   def __Where(self):
   818     """Consume the WHERE cluase.
   820     """Consume the WHERE cluase.
   819 
   821 
   820     These can have some recursion because of the AND symbol.
   822     These can have some recursion because of the AND symbol.