Skip to content

Commit 27c388e

Browse files
xiang.wangmmatczuk
xiang.wang
authored andcommitted
table: Added PrimaryKeyCmp() which returns copy of table's primaryKeyCmp.
1 parent fc0b7be commit 27c388e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

table/table.go

+7
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ func (t *Table) Metadata() Metadata {
6363
return t.metadata
6464
}
6565

66+
// PrimaryKeyCmp returns copy of table's primaryKeyCmp.
67+
func (t *Table) PrimaryKeyCmp() []qb.Cmp {
68+
primaryKeyCmp := make([]qb.Cmp, len(t.primaryKeyCmp))
69+
copy(primaryKeyCmp, t.primaryKeyCmp)
70+
return primaryKeyCmp
71+
}
72+
6673
// Name returns table name.
6774
func (t *Table) Name() string {
6875
return t.metadata.Name

0 commit comments

Comments
 (0)