Documentation ¶
Overview ¶
Package nnz defines variants of primitive types where the zero value represents null when (de)serializing with encoding/json and database/sql.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Int ¶
type Int int
Int is a wrapper around int where Go int(0) serializes to SQL/JSON null, and SQL/JSON null deserializes to Go int(0).
func (Int) MarshalJSON ¶
MarshalJSON implements the encoding/json.Marshaler interface.
func (*Int) UnmarshalJSON ¶
UnmarshalJSON implements the encoding/json.Unmarshaler interface.
type Int64 ¶
type Int64 int64
Int64 is a wrapper around int64 where Go int64(0) serializes to SQL/JSON null, and SQL/JSON null deserializes to Go int64(0).
func (Int64) MarshalJSON ¶
MarshalJSON implements the encoding/json.Marshaler interface.
func (*Int64) UnmarshalJSON ¶
UnmarshalJSON implements the encoding/json.Unmarshaler interface.
type String ¶
type String string
String is a wrapper around string where Go "" serializes to SQL/JSON null, and SQL/JSON null deserializes to Go "".
func (String) MarshalJSON ¶
MarshalJSON implements the encoding/json.Marshaler interface.
func (*String) UnmarshalJSON ¶
UnmarshalJSON implements the encoding/json.Unmarshaler interface.