resetQuery method

  1. @override
void resetQuery()
override

Drops every clause accumulated so far, leaving the table, alias and connection in place so the builder can be reused for a fresh query.

A builder never clears itself after executing — paginate depends on that, since it runs count() and get() off the same clauses. But a builder that outlives one query (a Model held on a relation, say) would otherwise carry its old WHEREs into the next one.

Implementation

@override
void resetQuery() {
  super.resetQuery();
  _orderBy.clear();
  _groupBy.clear();
  _having.clear();
  _limit = null;
  _offset = null;
  _paramCounter = 0;
  paramCounter = 0;
  resetCteState();
  resetWindowState();
}