修复数据上传时sockport的值可能为空的问题导致的错误

Signed-off-by: lixxxww <941403820@qq.com>
This commit is contained in:
lixxxww
2024-01-22 20:33:19 +00:00
committed by Gitee
parent 10bcd245ea
commit 76ed6737a2

View File

@@ -29,7 +29,7 @@ func (s *TdEngine) InsertDevice(deviceKey string, data map[string]interface{}) e
for k, v := range data {
field = append(field, k)
value = append(value, kgo.KConv.ToStr(v))
value = append(value, fmt.Sprintf("'%s'", kgo.KConv.ToStr(v)))
placeholders = append(placeholders, "?")
}