Example #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())
}
Example #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())
}
Example #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())
}
Example #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())
}
Example #5
0
// Truncate implements table.Table Truncate interface.
func (t *Table) Truncate(ctx context.Context) (err error) {
	return util.DelKeyWithPrefix(ctx, t.KeyPrefix())
}