Skip to content

Commit

Permalink
Add missing column name to INSERTs on NULL columns (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenson authored Jan 7, 2025
1 parent cbc6436 commit f11ea53
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func buildQueryForRow(primaryKeys PrimaryKeysResult, rowId string, row Row, depe
// Technically we allow more than null strings in ripoff files for templating purposes,
// but full support (ex: escaping arrays, what to do with maps, etc.) is quite hard so tabling that for now.
if valueRaw == nil {
columns = append(columns, pq.QuoteIdentifier(column))
values = append(values, "NULL")
setStatements = append(setStatements, fmt.Sprintf("%s = %s", pq.QuoteIdentifier(column), "NULL"))
} else {
Expand Down

0 comments on commit f11ea53

Please sign in to comment.