Skip to content

Commit

Permalink
fix(templates): Updating how we dereference the objects on insert many (
Browse files Browse the repository at this point in the history
#62)

Updating how we dereference the objects on insert many
  • Loading branch information
Jacobbrewer1 authored Dec 24, 2024
1 parent 119570e commit 7bc5f1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/_insert.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func InsertMany{{ $struct }}s(db DB, ms ...*{{ $struct }}) error {
vals := make([]any, 0, len(ms))
for _, m := range ms {
// Dereference the pointer to get the struct value.
vals = append(vals, []any{*m})
vals = append(vals, any(*m))
}

sqlstr, args, err := inserter.NewBatch(vals, inserter.WithTable({{ $struct | structify }}TableName)).GenerateSQL()
Expand Down

0 comments on commit 7bc5f1a

Please sign in to comment.