diff options
author | 2025-01-14 14:23:28 +0000 | |
---|---|---|
committer | 2025-01-14 14:23:28 +0000 | |
commit | b8ef9fc4bcccc6c024edaa8e9c91a6bf87f83dd9 (patch) | |
tree | 68eaf966c80237e18993e887c8583355f0943ca7 /vendor/github.com/uptrace/bun/query_values.go | |
parent | [chore] better dns validation (#3644) (diff) | |
download | gotosocial-b8ef9fc4bcccc6c024edaa8e9c91a6bf87f83dd9.tar.xz |
bump uptrace/bun dependencies from 1.2.6 to 1.2.8 (#3645)
Diffstat (limited to 'vendor/github.com/uptrace/bun/query_values.go')
-rw-r--r-- | vendor/github.com/uptrace/bun/query_values.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vendor/github.com/uptrace/bun/query_values.go b/vendor/github.com/uptrace/bun/query_values.go index 5c2abef60..97fbc65fa 100644 --- a/vendor/github.com/uptrace/bun/query_values.go +++ b/vendor/github.com/uptrace/bun/query_values.go @@ -14,6 +14,7 @@ type ValuesQuery struct { customValueQuery withOrder bool + comment string } var ( @@ -64,6 +65,12 @@ func (q *ValuesQuery) WithOrder() *ValuesQuery { return q } +// Comment adds a comment to the query, wrapped by /* ... */. +func (q *ValuesQuery) Comment(comment string) *ValuesQuery { + q.comment = comment + return q +} + func (q *ValuesQuery) AppendNamedArg(fmter schema.Formatter, b []byte, name string) ([]byte, bool) { switch name { case "Columns": @@ -121,6 +128,8 @@ func (q *ValuesQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, e return nil, errNilModel } + b = appendComment(b, q.comment) + fmter = formatterWithModel(fmter, q) if q.tableModel != nil { @@ -145,7 +154,7 @@ func (q *ValuesQuery) appendQuery( fields []*schema.Field, ) (_ []byte, err error) { b = append(b, "VALUES "...) - if q.db.features.Has(feature.ValuesRow) { + if q.db.HasFeature(feature.ValuesRow) { b = append(b, "ROW("...) } else { b = append(b, '(') @@ -168,7 +177,7 @@ func (q *ValuesQuery) appendQuery( for i := 0; i < sliceLen; i++ { if i > 0 { b = append(b, "), "...) - if q.db.features.Has(feature.ValuesRow) { + if q.db.HasFeature(feature.ValuesRow) { b = append(b, "ROW("...) } else { b = append(b, '(') |