summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/query_table_create.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2025-01-14 14:23:28 +0000
committerLibravatar GitHub <noreply@github.com>2025-01-14 14:23:28 +0000
commitb8ef9fc4bcccc6c024edaa8e9c91a6bf87f83dd9 (patch)
tree68eaf966c80237e18993e887c8583355f0943ca7 /vendor/github.com/uptrace/bun/query_table_create.go
parent[chore] better dns validation (#3644) (diff)
downloadgotosocial-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_table_create.go')
-rw-r--r--vendor/github.com/uptrace/bun/query_table_create.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/uptrace/bun/query_table_create.go b/vendor/github.com/uptrace/bun/query_table_create.go
index aeb79cd37..2c7855e7a 100644
--- a/vendor/github.com/uptrace/bun/query_table_create.go
+++ b/vendor/github.com/uptrace/bun/query_table_create.go
@@ -32,6 +32,7 @@ type CreateTableQuery struct {
fks []schema.QueryWithArgs
partitionBy schema.QueryWithArgs
tablespace schema.QueryWithArgs
+ comment string
}
var _ Query = (*CreateTableQuery)(nil)
@@ -129,6 +130,14 @@ func (q *CreateTableQuery) WithForeignKeys() *CreateTableQuery {
return q
}
+//------------------------------------------------------------------------------
+
+// Comment adds a comment to the query, wrapped by /* ... */.
+func (q *CreateTableQuery) Comment(comment string) *CreateTableQuery {
+ q.comment = comment
+ return q
+}
+
// ------------------------------------------------------------------------------
func (q *CreateTableQuery) Operation() string {
@@ -139,6 +148,9 @@ func (q *CreateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []by
if q.err != nil {
return nil, q.err
}
+
+ b = appendComment(b, q.comment)
+
if q.table == nil {
return nil, errNilModel
}