summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/query_index_drop.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/uptrace/bun/query_index_drop.go')
-rw-r--r--vendor/github.com/uptrace/bun/query_index_drop.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/vendor/github.com/uptrace/bun/query_index_drop.go b/vendor/github.com/uptrace/bun/query_index_drop.go
index ae28e7956..a2a23fb8a 100644
--- a/vendor/github.com/uptrace/bun/query_index_drop.go
+++ b/vendor/github.com/uptrace/bun/query_index_drop.go
@@ -15,7 +15,8 @@ type DropIndexQuery struct {
concurrently bool
ifExists bool
- index schema.QueryWithArgs
+ index schema.QueryWithArgs
+ comment string
}
var _ Query = (*DropIndexQuery)(nil)
@@ -74,6 +75,14 @@ func (q *DropIndexQuery) Index(query string, args ...interface{}) *DropIndexQuer
//------------------------------------------------------------------------------
+// Comment adds a comment to the query, wrapped by /* ... */.
+func (q *DropIndexQuery) Comment(comment string) *DropIndexQuery {
+ q.comment = comment
+ return q
+}
+
+//------------------------------------------------------------------------------
+
func (q *DropIndexQuery) Operation() string {
return "DROP INDEX"
}
@@ -83,6 +92,8 @@ func (q *DropIndexQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte
return nil, q.err
}
+ b = appendComment(b, q.comment)
+
b = append(b, "DROP INDEX "...)
if q.concurrently {