upstep bun to v1.0.9 (#252)

This commit is contained in:
tobi
2021-09-29 15:09:45 +02:00
committed by GitHub
parent 08cb8a3385
commit 9a53b1a8d1
53 changed files with 285 additions and 791 deletions

View File

@ -63,6 +63,11 @@ func (q *CreateTableQuery) ModelTableExpr(query string, args ...interface{}) *Cr
return q
}
func (q *CreateTableQuery) ColumnExpr(query string, args ...interface{}) *CreateTableQuery {
q.addColumn(schema.SafeQuery(query, args))
return q
}
//------------------------------------------------------------------------------
func (q *CreateTableQuery) Temp() *CreateTableQuery {
@ -132,6 +137,14 @@ func (q *CreateTableQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []by
}
}
for _, col := range q.columns {
b = append(b, ", "...)
b, err = col.AppendQuery(fmter, b)
if err != nil {
return nil, err
}
}
b = q.appendPKConstraint(b, q.table.PKs)
b = q.appendUniqueConstraints(fmter, b)
b, err = q.appenFKConstraints(fmter, b)