summaryrefslogtreecommitdiff
path: root/internal/db/bundb/basic.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/bundb/basic.go')
-rw-r--r--internal/db/bundb/basic.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/db/bundb/basic.go b/internal/db/bundb/basic.go
index cd80c9330..ef8b35574 100644
--- a/internal/db/bundb/basic.go
+++ b/internal/db/bundb/basic.go
@@ -94,12 +94,12 @@ func (b *basicDB) DeleteWhere(ctx context.Context, where []db.Where, i interface
return b.conn.ProcessError(err)
}
-func (b *basicDB) UpdateByPrimaryKey(ctx context.Context, i interface{}, columns ...string) db.Error {
+func (b *basicDB) UpdateByID(ctx context.Context, i interface{}, id string, columns ...string) db.Error {
q := b.conn.
NewUpdate().
Model(i).
Column(columns...).
- WherePK()
+ Where("? = ?", bun.Ident("id"), id)
_, err := q.Exec(ctx)
return b.conn.ProcessError(err)
@@ -110,7 +110,7 @@ func (b *basicDB) UpdateWhere(ctx context.Context, where []db.Where, key string,
updateWhere(q, where)
- q = q.Set("? = ?", bun.Safe(key), value)
+ q = q.Set("? = ?", bun.Ident(key), value)
_, err := q.Exec(ctx)
return b.conn.ProcessError(err)