whereIds gets a list of names and a list of values for all columns marked as primary keys.
()
| 565 | // whereIds gets a list of names and a list of values for all columns marked as primary |
| 566 | // keys. |
| 567 | func (s *DbRecorder) whereIds() map[string]interface{} { |
| 568 | clause := make(map[string]interface{}, len(s.key)) |
| 569 | |
| 570 | ar := reflect.Indirect(reflect.ValueOf(s.record)) |
| 571 | |
| 572 | for _, f := range s.key { |
| 573 | clause[f.column] = ar.FieldByName(f.name).Interface() |
| 574 | } |
| 575 | |
| 576 | return clause |
| 577 | } |
| 578 | |
| 579 | // scanFields extracts the tags from all of the fields on a struct. |
| 580 | func (s *DbRecorder) scanFields(ar Record) { |