Flatten params for Insert exec
Go Tests / test (push) Failing after 6s

This commit is contained in:
2026-05-24 21:16:30 +02:00
parent a6ff01d694
commit 127e2d8e84
+11 -1
View File
@@ -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