Documentation ¶
Overview ¶
Package nisql provides nullable types for database operations with proper json marshalling and unmarshalling
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NullBool ¶
NullBool is a type that can be null or a bool
func (*NullBool) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*NullBool) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type NullFloat64 ¶
type NullFloat64 struct {
sql.NullFloat64
}
NullFloat64 is a type that can be null or a float64
func (*NullFloat64) Get ¶
func (n *NullFloat64) Get() *float64
Get returns nil or underlying float64 value
func (*NullFloat64) MarshalJSON ¶
func (n *NullFloat64) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*NullFloat64) UnmarshalJSON ¶
func (n *NullFloat64) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type NullInt64 ¶
NullInt64 is a type that can be null or an int
func (*NullInt64) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*NullInt64) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
type NullString ¶
type NullString struct {
sql.NullString
}
NullString is a type that can be null or a string
func (*NullString) Get ¶
func (n *NullString) Get() *string
Get returns nil or underlying string value
func (*NullString) MarshalJSON ¶
func (n *NullString) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*NullString) UnmarshalJSON ¶
func (n *NullString) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
type NullTime ¶
NullTime is a type that can be null or a time.Time
func (*NullTime) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*NullTime) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.