Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
naorpeled committed Jan 9, 2025
1 parent 15bcf77 commit 5c20a79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/parser/insert-values-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ function parseColumnNamesAndIndexes(
const cols = Object.keys(row)

for (const col of cols) {
if (!columns.has(col)) {
const shouldIncludeColumnWithUndefined =
rows.length > 1 && rows.some((row) => row[col] !== undefined)

if (!columns.has(col) && shouldIncludeColumnWithUndefined) {
columns.set(col, columns.size)
}
}
Expand Down

0 comments on commit 5c20a79

Please sign in to comment.