finclip-app-manager/vendor/gorm.io/gorm/clause/locking.go

32 lines
610 B
Go
Raw Normal View History

2023-11-02 18:36:36 +08:00
package clause
type Locking struct {
Strength string
Table Table
Options string
}
// Name where clause name
func (locking Locking) Name() string {
return "FOR"
}
// Build build where clause
func (locking Locking) Build(builder Builder) {
builder.WriteString(locking.Strength)
if locking.Table.Name != "" {
builder.WriteString(" OF ")
builder.WriteQuoted(locking.Table)
}
if locking.Options != "" {
builder.WriteByte(' ')
builder.WriteString(locking.Options)
}
}
// MergeClause merge order by clauses
func (locking Locking) MergeClause(clause *Clause) {
clause.Expression = locking
}