diff --git a/database/sq.go b/database/sq.go index 3fbe5ab9d5da06719e9135f18de8a3cec5adc60a..cda4614933bbb5f175ae977a0597e2a36647afd2 100644 --- a/database/sq.go +++ b/database/sq.go @@ -134,7 +134,12 @@ update = update.Set(WithAlias(m.Alias(), f.SQL), reflect.Indirect(rv).Interface()) } } else { - panic(fmt.Errorf("TODO")) + if !rv.IsValid() { + panic(fmt.Errorf("Invariant violated (unsetting non-nullable field)")) + } else { + pv.Set(rv) + update = update.Set(WithAlias(m.Alias(), f.SQL), rv.Interface()) + } } }