src/Connection_Counter.php
public function execute(Expression $expr)
    {
        if ($expr instanceof Query) {
            $this->queries++;
            if ($expr->mode === 'select' || $expr->mode === null) {
                $this->selects++;
            }
        } else {
            $this->expressions++;
        }

        try {
            $ret = parent::execute($expr);
        } catch (\Exception $e) {
            if ($this->callback && is_callable($this->callback)) {
                call_user_func($this->callback, $this->queries, $this->selects, $this->rows, $this->expressions, true);
            } else {
                printf(
                    "[ERROR] Queries: %3d, Selects: %3d, Rows fetched: %4d, Expressions %3d\n",
                    $this->queries,
                    $this->selects,
                    $this->rows,
                    $this->expressions
                );
            }

            throw $e;
        }

        return $this->iterate($ret);
    }
public function execute(Expression $expr)
    {
        if ($expr instanceof Query) {
            $this->queries++;
            if ($expr->mode === 'select' || $expr->mode === null) {
                $this->selects++;
            }
        } else {
            $this->expressions++;
        }

        try {
            $ret = parent::execute($expr);
        } catch (\Exception $e) {
            if ($this->callback && is_callable($this->callback)) {
                call_user_func($this->callback, $this->queries, $this->selects, $this->rows, $this->expressions, true);
            } else {
                printf(
                    "[ERROR] Queries: %3d, Selects: %3d, Rows fetched: %4d, Expressions %3d\n",
                    $this->queries,
                    $this->selects,
                    $this->rows,
                    $this->expressions
                );
            }

            throw $e;
        }

        return $this->iterate($ret);
    }
Execute expression.

@param Expression $expr

@return mixed