nodes: 0, module; 1, function_definition; 2, function_name:all; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, with_statement; 10, identifier:order_by; 11, None; 12, identifier:limit; 13, integer:0; 14, comment:"""
              Fetch all items.
  
              :param limit: How many rows to fetch.
              :param order_by: column on which to order the results. \
              To change the sort, prepend with < or >.
  
          """; 15, with_clause; 16, block; 17, with_item; 18, try_statement; 19, as_pattern; 20, block; 21, except_clause; 22, else_clause; 23, call; 24, as_pattern_target; 25, expression_statement; 26, if_statement; 27, if_statement; 28, expression_statement; 29, expression_statement; 30, as_pattern; 31, block; 32, block; 33, identifier:rconnect; 34, argument_list; 35, identifier:conn; 36, assignment; 37, comparison_operator:order_by is not None; 38, block; 39, comparison_operator:limit > 0; 40, block; 41, call; 42, assignment; 43, identifier:Exception; 44, as_pattern_target; 45, expression_statement; 46, raise_statement; 47, expression_statement; 48, return_statement; 49, identifier:query; 50, call; 51, identifier:order_by; 52, None; 53, expression_statement; 54, identifier:limit; 55, integer:0; 56, expression_statement; 57, attribute; 58, argument_list; 59, identifier:rv; 60, call; 61, identifier:e; 62, call; 63, assignment; 64, identifier:data; 65, attribute; 66, argument_list; 67, assignment; 68, assignment; 69, identifier:log; 70, identifier:debug; 71, identifier:query; 72, attribute; 73, argument_list; 74, attribute; 75, argument_list; 76, identifier:data; 77, list_comprehension; 78, identifier:self; 79, identifier:_base; 80, identifier:query; 81, call; 82, identifier:query; 83, call; 84, identifier:query; 85, identifier:run; 86, identifier:conn; 87, identifier:log; 88, identifier:warn; 89, identifier:e; 90, call; 91, for_in_clause; 92, attribute; 93, argument_list; 94, attribute; 95, argument_list; 96, attribute; 97, argument_list; 98, identifier:_; 99, identifier:rv; 100, identifier:self; 101, identifier:_order_by; 102, identifier:query; 103, identifier:order_by; 104, identifier:self; 105, identifier:_limit; 106, identifier:query; 107, identifier:limit; 108, identifier:self; 109, identifier:_model; 110, identifier:_
code: def all(self, order_by=None, limit=0):
          """
              Fetch all items.
  
              :param limit: How many rows to fetch.
              :param order_by: column on which to order the results. \
              To change the sort, prepend with < or >.
  
          """
          with rconnect() as conn:
              try:
                  query = self._base()
                  if order_by is not None:
                      query = self._order_by(query, order_by)
                  if limit > 0:
                      query = self._limit(query, limit)
  
                  log.debug(query)
                  rv = query.run(conn)
              except Exception as e:
                  log.warn(e)
                  raise
              else:
                  data = [self._model(_) for _ in rv]
                  return data