Skip to content

Commit

Permalink
Added docs for DbMap.TableFor
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cooper committed May 16, 2014
1 parent 4593fad commit 214aeb9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gorp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,9 @@ func (m *DbMap) Begin() (*Transaction, error) {
return &Transaction{m, tx, false}, nil
}

// TableFor returns the *TableMap corresponding to the given Go Type
// If no table is mapped to that type an error is returned.
// If checkPK is true and the mapped table has no registered PKs, an error is returned.
func (m *DbMap) TableFor(t reflect.Type, checkPK bool) (*TableMap, error) {
table := tableOrNil(m, t)
if table == nil {
Expand Down

0 comments on commit 214aeb9

Please sign in to comment.