client-version: github.com/vesoft-inc/nebula-go/v3 v3.5.0
go version: go1.20
nebula: v3.0
我想实现在sql中如下效果:
db.Exec(“insert into table(level, address, files) values (?, ?, ?)”, level, address, files)
我注意到了nebula-go,数据入库ExecuteWithParameter报错ErrorCode: -1005 这篇帖子,我在测试环境下尝试了ExecuteWithParameter API,但是它不可用,测试如下:
args := map[string]any{
"p1": &nebulatyp.Value{IVal: &level},
"p2": &nebulatyp.Value{SVal: []byte(address)},
"p3": &nebulatyp.Value{SVal: []byte(files)},
}
s := "INSERT VERTEX my_vid (level, address, files) VALUES \"abcd1234\": ($p1, $p2, $p3);"
和以下测试:
args := map[string]any{
"p1": level,
"p2": address,
"p3": files,
}
s := "INSERT VERTEX my_vid (level, address, files) VALUES \"abcd1234\": ($p1, $p2, $p3);"
它们分别响应了不同的错误:
Storage Error: The data type does not meet the requirements. Use the correct type of data.
Only support convert boolean/float/int/string/map/list to nebula.Value but *nebula.Value cmd