From c6b1a1664c1830fb2a4b834b10d7d05ec6ff9aeb Mon Sep 17 00:00:00 2001 From: yanghao05 Date: Fri, 23 May 2025 22:07:26 +0800 Subject: [PATCH] feat: update --- pkg/ast/model/table_funcs.go.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ast/model/table_funcs.go.tpl b/pkg/ast/model/table_funcs.go.tpl index f81ec43..4b000f0 100644 --- a/pkg/ast/model/table_funcs.go.tpl +++ b/pkg/ast/model/table_funcs.go.tpl @@ -76,7 +76,7 @@ func (m *{{.PascalTable}}) BatchDelete(ctx context.Context, ids []int64) error { } func (m *{{.PascalTable}}) Update(ctx context.Context) error { - stmt := table.{{.PascalTable}}.UPDATE(table.{{.PascalTable}}.MutableColumns).SET(m).WHERE(table.{{.PascalTable}}.ID.EQ()).RETURNING(table.{{.PascalTable}}.AllColumns) + stmt := table.{{.PascalTable}}.UPDATE(table.{{.PascalTable}}.MutableColumns).SET(m).WHERE(table.{{.PascalTable}}.ID.EQ(Int(m.ID))).RETURNING(table.{{.PascalTable}}.AllColumns) m.log().WithField("func", "Update").Info(stmt.DebugSql()) if err := stmt.QueryContext(ctx, db, m); err != nil {