Hey.
There is some inconvinience while working with NULL values in database.
Using of sql.NullString or sql.NullInt64 requires extra mapping layer between struct-to-store an struct-to-send (json), because direct marshaling NullString/NullInt64 to json is insane.
All that I need is gorm:"nullable"
that will convert 0 and "" to NULL in SQL string before execution.
Use pointer of a type to be nullable. like use *string
Why use sql.Null* in docs? Anyone have a link to pros/con of using pointer vs sql.Null?
Most helpful comment
Use pointer of a type to be nullable. like use
*string