Skip to content

Commit

Permalink
ADD slice value wrap for sql args.
Browse files Browse the repository at this point in the history
ADD slice value wrap for sql args.
  • Loading branch information
karminski committed Jan 18, 2024
1 parent b0078a6 commit 249038b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/parser/sql/escaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,13 @@ func (sqlEscaper *SQLEscaper) EscapeSQLActionTemplate(sql string, args map[strin
if errInReflect != nil {
return "", nil, errInReflect
}
userArgs = append(userArgs, variableMappedValueInString)
// check if variable is slice then use raw value
typeOfVariableMappedValue := reflect.TypeOf(variableMappedValue).Kind()
if typeOfVariableMappedValue == reflect.Slice {
userArgs = append(userArgs, variableMappedValue)
} else {
userArgs = append(userArgs, variableMappedValueInString)
}
} else {
userArgs = append(userArgs, variableMappedValue)
}
Expand Down

0 comments on commit 249038b

Please sign in to comment.