mdbc/drop.go

26 lines
423 B
Go
Raw Normal View History

2023-06-22 15:14:51 +00:00
package mdbc
import "context"
type dropScope struct {
2023-06-23 15:56:52 +00:00
scope *scope
mdbc *mdbc
ctx context.Context
2023-06-22 15:14:51 +00:00
}
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()
2023-06-23 15:56:52 +00:00
return ds.mdbc.database.Collection(ds.scope.tableName).Drop(ds.ctx)
2023-06-22 15:14:51 +00:00
}