protected function compileInsertFromValues($table, string $tableAlias = null, array $values): array
    {
        if (empty($values)) {
            return [];
        }

        $bindings = [];

        // Step 1. Fetch unique columns list.
        $columns = [];
        foreach ($values as $row) {
            foreach ($row as $column => $value) {
                if (!isset($columns[$column])) {
                    $columns[$column] = count($columns);
                }
            }
        }

        // Step 2. Build the values matrix.
        $compiledRows = [];
        foreach ($values as $row) {
            $compiledRow = [];
            foreach ($columns as $column => $columnIndex) {
                if (array_key_exists($column, $row)) {
                    $compiledRow[$columnIndex] = $this->compileValue($row[$column], $bindings);
                } else {
                    $compiledRow[$columnIndex] = 'DEFAULT';
                }
            }
            $compiledRows[] = '('.implode(', ', $compiledRow).')';
        }

        // Step 3. Build the SQL
        $sqlLine1 = 'INSERT INTO '.$this->compileIdentifierWithAlias($table, $tableAlias, $bindings)
            . ' ('.implode(', ', array_map([$this, 'quoteCompositeIdentifier'], array_keys($columns))).')';
        $sqlLine2 = 'VALUES '.implode(', ', $compiledRows);

        return [new Raw($this->implodeSQL([$sqlLine1, $sqlLine2]), $bindings)];
    }