summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/query_update.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/uptrace/bun/query_update.go')
-rw-r--r--vendor/github.com/uptrace/bun/query_update.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/vendor/github.com/uptrace/bun/query_update.go b/vendor/github.com/uptrace/bun/query_update.go
index 23c722f56..5ac394453 100644
--- a/vendor/github.com/uptrace/bun/query_update.go
+++ b/vendor/github.com/uptrace/bun/query_update.go
@@ -452,9 +452,12 @@ func (q *UpdateQuery) afterUpdateHook(ctx context.Context) error {
// FQN returns a fully qualified column name. For MySQL, it returns the column name with
// the table alias. For other RDBMS, it returns just the column name.
-func (q *UpdateQuery) FQN(name string) Ident {
- if q.db.fmter.HasFeature(feature.UpdateMultiTable) {
- return Ident(q.table.Alias + "." + name)
+func (q *UpdateQuery) FQN(column string) Ident {
+ if q.table == nil {
+ panic("UpdateQuery.FQN requires a model")
+ }
+ if q.db.HasFeature(feature.UpdateMultiTable) {
+ return Ident(q.table.Alias + "." + column)
}
- return Ident(name)
+ return Ident(column)
}