From ad516d5e1f2631596882a632e0d538cb0f70bfea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Garcia?= Date: Tue, 18 Oct 2022 10:50:58 -0300 Subject: [PATCH] Add comment to json modifier --- internal/modifiers/json_modifier.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/modifiers/json_modifier.go b/internal/modifiers/json_modifier.go index f408c5f..8cb6b8c 100644 --- a/internal/modifiers/json_modifier.go +++ b/internal/modifiers/json_modifier.go @@ -29,6 +29,8 @@ var jsonModifier = AttrModifier{ Value: func(ctx context.Context, opInfo OpInfo, inputValue interface{}) (outputValue interface{}, _ error) { b, err := json.Marshal(inputValue) + // SQL server uses the NVARCHAR type to store JSON and + // it expects to receive strings not []byte, thus: if opInfo.DriverName == "sqlserver" { return string(b), err }