Skip to content

Commit

Permalink
table: Added PrimaryKeyCmp() which returns copy of table's primaryKey…
Browse files Browse the repository at this point in the history
…Cmp.
  • Loading branch information
xiang.wang authored and mmatczuk committed Apr 8, 2020
1 parent fc0b7be commit 27c388e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27c388e

Please sign in to comment.