mirror of https://github.com/VinGarcia/ksql.git
Add comment to json modifier
parent
136ee66fe9
commit
ad516d5e1f
|
@ -29,6 +29,8 @@ var jsonModifier = AttrModifier{
|
||||||
|
|
||||||
Value: func(ctx context.Context, opInfo OpInfo, inputValue interface{}) (outputValue interface{}, _ error) {
|
Value: func(ctx context.Context, opInfo OpInfo, inputValue interface{}) (outputValue interface{}, _ error) {
|
||||||
b, err := json.Marshal(inputValue)
|
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" {
|
if opInfo.DriverName == "sqlserver" {
|
||||||
return string(b), err
|
return string(b), err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue