public function rollback() : bool
    {
        $sql = 'ROLLBACK';

        if (!$this->transactionStarted) {
            $event = new TimerEvent('db.query');
            $this->emitQueryEvent($event, null, $sql);

            throw new QueryException(
                $this,
                $sql,
                "Can't rollback unstarted transaction"
            );
        }

        $this->query($sql);
        $this->transactionStarted = false;

        $this->instanceDispatcher()->emit(new Event('db.rollback'));

        return true;
    }