public function compileInsert(Builder $query, array $values) {
    foreach($values as &$row) {
      $this->beforePut($row);
    }

    unset($row);

    $this->remapWheres($query);
    $sql = $this->grammar->compileInsert($query, $values);

    if($this->replace_into) {
      $sql = preg_replace('/^insert into/i', 'replace into', $sql);
      $this->replace_into = false;
    }

    return $sql;
  }