From 7bc5f1a7951f5e42ad52ebf93ab246f2ee6acab9 Mon Sep 17 00:00:00 2001 From: Jacob Brewer Date: Tue, 24 Dec 2024 14:13:29 +0000 Subject: [PATCH] fix(templates): Updating how we dereference the objects on insert many (#62) Updating how we dereference the objects on insert many --- templates/_insert.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/_insert.tmpl b/templates/_insert.tmpl index 7d514fd..091fcad 100644 --- a/templates/_insert.tmpl +++ b/templates/_insert.tmpl @@ -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()