public function quote(Query $query)
    {
        $binder = $query->getValueBinder();
        $query->setValueBinder(false);

        if ($query->type() === 'insert') {
            $this->_quoteInsert($query);
        } elseif ($query->type() === 'update') {
            $this->_quoteUpdate($query);
        } else {
            $this->_quoteParts($query);
        }

        $query->traverseExpressions([$this, 'quoteExpression']);
        $query->setValueBinder($binder);

        return $query;
    }