Skip to content

Commit

Permalink
Update statements to handle Non-incrementing PK's
Browse files Browse the repository at this point in the history
The change in this if statement allows for the driver to correctly
handle non-auto-incrementing primary keys. The check has been changed to
if it is auto-incrementing or transient.
  • Loading branch information
kungfumike authored and James Cooper committed May 14, 2014
1 parent ed5dce5 commit 9259f03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gorp.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func (t *TableMap) bindUpdate(elem reflect.Value) (bindInstance, error) {

for y := range t.columns {
col := t.columns[y]
if !col.isPK && !col.Transient {
if !col.isAutoIncr && !col.Transient {
if x > 0 {
s.WriteString(", ")
}
Expand Down

0 comments on commit 9259f03

Please sign in to comment.