From 9259f03aa6d4d724149e1c4ec5ef040e6e587262 Mon Sep 17 00:00:00 2001 From: Mike Thompson Date: Mon, 7 Apr 2014 16:06:36 -0700 Subject: [PATCH] Update statements to handle Non-incrementing PK's 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. --- gorp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gorp.go b/gorp.go index 4c08b494..e8ce73a4 100644 --- a/gorp.go +++ b/gorp.go @@ -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(", ") }