New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset SQL results table when the query has not returned data #1437

Merged
merged 1 commit into from Jun 21, 2018

Conversation

Projects
None yet
3 participants
@mgrojo
Copy link
Contributor

mgrojo commented Jun 19, 2018

When we know that the just executed query has not returned data, reset the
table results model, so the results view is also reset.

Added QAbstractItemModel::beginResetModel() and
QAbstractItemModel::endResetModel() to the model's reset method. This
resets completely the table view.

This improves the situation for #1431, without addressing the underlying
problem of not detecting correctly the type of query. In any case, any
query not returning data should reset the results from previous queries.

Reset SQL results table when the query has not returned data
When we know that the just executed query has not returned data, reset the
table results model, so the results view is also reset.

Added QAbstractItemModel::beginResetModel() and
QAbstractItemModel::endResetModel() to the model's reset method. This
resets completely the table view.

This improves the situation for #1431, without addressing the underlying
problem of not detecting correctly the type of query. In any case, any
query not returning data should reset the results from previous queries.
@justinclift

This comment has been minimized.

Copy link
Member

justinclift commented Jun 19, 2018

Agreed, the concept sounds right. 😄

@MKleusberg

This comment has been minimized.

Copy link
Member

MKleusberg commented Jun 21, 2018

Yep, seems right. I think the only reason why we didn't clear the table view there was that it's more convenient to view the results of a query and then issue insert/delete/update/... commands based on that without getting your query results removed. But I guess it's causing more confusion than being useful. Also this is why we have added SQL tabs in the meantime.

So I'm just going to merge this. I hope nobody minds 😉 Thanks Manuel!

@MKleusberg MKleusberg merged commit 01f0146 into master Jun 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MKleusberg MKleusberg deleted the reset_results branch Jun 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment