summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/db.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-12-12 15:47:51 +0100
committerLibravatar GitHub <noreply@github.com>2021-12-12 15:47:51 +0100
commit67ac8db190eb82a7758746fb021fa3014f4241b7 (patch)
tree4a4124ad8f0ee9ec8858b109dd0bcc2e567fc144 /vendor/github.com/uptrace/bun/db.go
parentupstep dependencies (#339) (diff)
downloadgotosocial-67ac8db190eb82a7758746fb021fa3014f4241b7.tar.xz
Upstep Go dependencies (#340)
* Upstep Go dependencies * tiny linter fix * Tidy
Diffstat (limited to 'vendor/github.com/uptrace/bun/db.go')
-rw-r--r--vendor/github.com/uptrace/bun/db.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/uptrace/bun/db.go b/vendor/github.com/uptrace/bun/db.go
index c32474cef..a83b07d35 100644
--- a/vendor/github.com/uptrace/bun/db.go
+++ b/vendor/github.com/uptrace/bun/db.go
@@ -203,6 +203,15 @@ func (db *DB) Formatter() schema.Formatter {
return db.fmter
}
+// UpdateFQN 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 (db *DB) UpdateFQN(alias, column string) Ident {
+ if db.HasFeature(feature.UpdateMultiTable) {
+ return Ident(alias + "." + column)
+ }
+ return Ident(column)
+}
+
// HasFeature uses feature package to report whether the underlying DBMS supports this feature.
func (db *DB) HasFeature(feat feature.Feature) bool {
return db.fmter.HasFeature(feat)