+11
-1
@@ -288,7 +288,17 @@ func (ins *Insert[T]) execute(conn *simpleorm.DBConnection, tx *sql.Tx) error {
|
|||||||
}
|
}
|
||||||
defer stmt.Close()
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user