def find_highest_position(cur, node):
    """
    Return highest, not occupied position in the children of ``node``.

    :param node:
    :type node: Node or uuid4
    """
    if node is not None:
        id = str(node)
    else:
        id = None
    sql = """
      SELECT
        MAX(position)
      FROM
        nodes
      WHERE
        parent=%s;
    """
    cur.execute(sql, (id,))
    result = cur.fetchone()['max']
    if result is not None:
        return result
    else:
        return -1
