Пример #1
0
// Truncate implements table.Table Truncate interface.
func (t *Table) Truncate(ctx context.Context) (err error) {
	err = util.DelKeyWithPrefix(ctx, t.KeyPrefix())
	if err != nil {
		return
	}
	return util.DelKeyWithPrefix(ctx, t.IndexPrefix())
}
Пример #2
0
// Truncate implements table.Table Truncate interface.
func (t *Table) Truncate(rm kv.RetrieverMutator) error {
	err := util.DelKeyWithPrefix(rm, t.RecordPrefix())
	if err != nil {
		return errors.Trace(err)
	}
	return util.DelKeyWithPrefix(rm, t.IndexPrefix())
}
Пример #3
0
// Truncate implements table.Table Truncate interface.
func (t *Table) Truncate(ctx context.Context) error {
	err := util.DelKeyWithPrefix(ctx, t.KeyPrefix())
	if err != nil {
		return errors.Trace(err)
	}
	return util.DelKeyWithPrefix(ctx, t.IndexPrefix())
}
Пример #4
0
// Truncate implements table.Table Truncate interface.
func (t *Table) Truncate(ctx context.Context) error {
	txn, err := ctx.GetTxn(false)
	if err != nil {
		return errors.Trace(err)
	}
	err = util.DelKeyWithPrefix(txn, t.RecordPrefix())
	if err != nil {
		return errors.Trace(err)
	}
	return util.DelKeyWithPrefix(txn, t.IndexPrefix())
}
Пример #5
0
// Truncate implements table.Table Truncate interface.
func (t *Table) Truncate(ctx context.Context) (err error) {
	return util.DelKeyWithPrefix(ctx, t.KeyPrefix())
}