refactor updateQuery to use abstract dialect