From 27c388ea3297bcaf96ceea1f22515518a6e62457 Mon Sep 17 00:00:00 2001 From: "xiang.wang" Date: Wed, 1 Apr 2020 10:12:56 +0800 Subject: [PATCH] table: Added PrimaryKeyCmp() which returns copy of table's primaryKeyCmp. --- table/table.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/table/table.go b/table/table.go index 71c5817..73c7f28 100644 --- a/table/table.go +++ b/table/table.go @@ -63,6 +63,13 @@ func (t *Table) Metadata() Metadata { return t.metadata } +// PrimaryKeyCmp returns copy of table's primaryKeyCmp. +func (t *Table) PrimaryKeyCmp() []qb.Cmp { + primaryKeyCmp := make([]qb.Cmp, len(t.primaryKeyCmp)) + copy(primaryKeyCmp, t.primaryKeyCmp) + return primaryKeyCmp +} + // Name returns table name. func (t *Table) Name() string { return t.metadata.Name