From 127e2d8e84960f74a3850377fe608f3bbf0b9120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Dulai?= Date: Sun, 24 May 2026 21:16:30 +0200 Subject: [PATCH] Flatten params for Insert exec --- exec/exec.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/exec/exec.go b/exec/exec.go index 3d46575..72bd1e9 100644 --- a/exec/exec.go +++ b/exec/exec.go @@ -288,7 +288,17 @@ func (ins *Insert[T]) execute(conn *simpleorm.DBConnection, tx *sql.Tx) error { } defer stmt.Close() - rows, err := stmt.Query(params...) + // Flattent args to make sure it can be parsed correctly + var flatParams []any + for _, param := range params { + if s, ok := param.([]any); ok { + flatParams = append(flatParams, s...) + } else { + flatParams = append(flatParams, param) + } + } + + rows, err := stmt.Query(flatParams...) if err != nil { return err