mdbc/drop.go

26 lines
398 B
Go
Raw Normal View History

2023-06-22 15:14:51 +00:00
package mdbc
import "context"
type dropScope struct {
*scope
*mdbc
ctx context.Context
}
func (ds *dropScope) SetContext(ctx context.Context) *dropScope {
ds.ctx = ctx
return ds
}
func (ds *dropScope) mergeOptions() {
if ds.ctx == nil {
ds.ctx = context.Background()
}
}
func (ds *dropScope) Do() error {
ds.mergeOptions()
return ds.database.Collection(ds.tableName).Drop(ds.ctx)
}