Feature model postgresql (#842)
* Support postgresql generate * Update template Var * Support to generate postgresql model * Support to generate postgresql model * Update template Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util/stringx"
|
||||
)
|
||||
|
||||
func genUpdate(table Table, withCache bool) (string, string, error) {
|
||||
func genUpdate(table Table, withCache, postgreSql bool) (string, string, error) {
|
||||
expressionValues := make([]string, 0)
|
||||
for _, field := range table.Fields {
|
||||
camel := field.Name.ToCamel()
|
||||
@@ -50,8 +50,9 @@ func genUpdate(table Table, withCache bool) (string, string, error) {
|
||||
"primaryCacheKey": table.PrimaryCacheKey.DataKeyExpression,
|
||||
"primaryKeyVariable": table.PrimaryCacheKey.KeyLeft,
|
||||
"lowerStartCamelObject": stringx.From(camelTableName).Untitle(),
|
||||
"originalPrimaryKey": wrapWithRawString(table.PrimaryKey.Name.Source()),
|
||||
"originalPrimaryKey": wrapWithRawString(table.PrimaryKey.Name.Source(), postgreSql),
|
||||
"expressionValues": strings.Join(expressionValues, ", "),
|
||||
"postgreSql": postgreSql,
|
||||
})
|
||||
if err != nil {
|
||||
return "", "", nil
|
||||
|
||||
Reference in New Issue
Block a user