table: Added PrimaryKeyCmp() which returns copy of table's primaryKeyCmp.

This commit is contained in:
xiang.wang authored and Michal Jan Matczuk committed 2020-04-08 09:23:19 +02:00
1 parent fc0b7be8ab
commit 27c388ea32
1 file changed
+7
+7
View File
@@ -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