Open cbelsole opened 6 years ago
Added support for setting a nullable field. Previously this would fail because a nil pointer cannot be set:
# Nullable *string `db:"nullable"` person3 := Person{Name: "Barack", Nullable: nil} err = s. InsertInto("people"). Columns("name", "nullable"). Record(person3). Returning("id", "nullable"). QueryStruct(&person3)
The fix (discovered by @pascallouisperez) is to skip fields that !v.CanSet().
!v.CanSet()
I added tests for inserting selecting and updating nullable fields.
Issue
Added support for setting a nullable field. Previously this would fail because a nil pointer cannot be set:
Fix
The fix (discovered by @pascallouisperez) is to skip fields that
!v.CanSet()
.Tests
I added tests for inserting selecting and updating nullable fields.