Fix/issue#1447 (#1458)

* Add data for template to render

* fix #1447

Co-authored-by: anqiansong <anqiansong@bytedance.com>
This commit is contained in:
anqiansong
2022-01-18 10:36:38 +08:00
committed by GitHub
parent bf2feee5b7
commit e57fa8ff53
12 changed files with 33 additions and 14 deletions

View File

@@ -62,6 +62,7 @@ func genInsert(table Table, withCache, postgreSql bool) (string, string, error)
"expressionValues": strings.Join(expressionValues, ", "),
"keys": strings.Join(keySet.KeysStr(), "\n"),
"keyValues": strings.Join(keyVariableSet.KeysStr(), ", "),
"data": table,
})
if err != nil {
return "", "", err
@@ -75,6 +76,7 @@ func genInsert(table Table, withCache, postgreSql bool) (string, string, error)
insertMethodOutput, err := util.With("insertMethod").Parse(text).Execute(map[string]interface{}{
"upperStartCamelObject": camel,
"data": table,
})
if err != nil {
return "", "", err