def ReadGRRUsers(self, offset=0, count=None, cursor=None):
    """Reads GRR users with optional pagination, sorted by username."""
    if count is None:
      count = 18446744073709551615  # 2^64-1, as suggested by MySQL docs

    cursor.execute(
        "SELECT username, password, ui_mode, canary_mode, user_type "
        "FROM grr_users ORDER BY username ASC "
        "LIMIT %s OFFSET %s", [count, offset])
    return [self._RowToGRRUser(row) for row in cursor.fetchall()]