public function getQuery(): Query
    {
        if ($this->table === null) {
            throw new Exception('Unable to build DELETE query when table name is not set');
        }

        $sql = "DELETE FROM {$this->table}";

        if ($this->hasWhere()) {
            $sql .= "\nWHERE{$this->getWhereSql()}";
        }

        return new Query($sql, $this->getBindings(), $this->getAdapterConnection());
    }