def get_game_ids_by_tournament(cursor, tournament, patch=None):
    """
    getMatchIdsByTournament queries the connected db for game ids which match the
    input tournament string.

    Args:
        cursor (sqlite cursor): cursor used to execute commmands
        tournament (string): id string for tournament (ie "2017/EU/Summer_Split")
        patch (string, optional): id string for patch to additionally filter
    Returns:
        gameIds (list(int)): list of gameIds
    """
    if patch:
        query = "SELECT id FROM game WHERE tournament=? AND patch=? ORDER BY id"
        params = (tournament, patch)
    else:
        query = "SELECT id FROM game WHERE tournament=? ORDER BY id"
        params = (tournament,)
    cursor.execute(query, params)
    response = cursor.fetchall()
    vals = []
    for r in response:
        vals.append(r[0])
    return vals