Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedType = errors.New("unsupported type")
Functions ¶
This section is empty.
Types ¶
type JSON ¶ added in v0.2.0
func (JSON[T]) MarshalJSON ¶ added in v0.2.1
func (*JSON[T]) UnmarshalJSON ¶ added in v0.2.1
type Map ¶
func (*Map[T]) UnmarshalJSON ¶ added in v0.4.1
type Null ¶ added in v0.2.3
type Null[T any] struct { sql.Null[T] // ParsedNull is a helper field to distinguish between a null value and an omitted field during JSON unmarshalling. // - if the field is present in the JSON (even if it's null), ParsedNull will be true. ParsedNull bool `json:"-"` }
func NewNull ¶ added in v0.2.5
NewNull creates a Null[T] with the given value and Valid set to true.
func NewNullFromPtr ¶ added in v0.4.5
NewNullFromPtr creates a Null[T] from a pointer to T.
- If the pointer is nil, it returns a Null[T] with Valid set to false and V set to the zero value of T.
func NewNullWithValid ¶ added in v0.4.5
NewNullWithValid creates a Null[T] with the given value and Valid set to the specified boolean.
func NewTimeNullWithValid ¶ added in v0.4.8
func (Null[T]) MarshalJSON ¶ added in v0.2.3
func (Null[T]) Ptr ¶ added in v0.4.3
func (n Null[T]) Ptr() *T
Ptr returns a pointer to the inner value if Valid is true, otherwise it returns nil.
func (*Null[T]) UnmarshalJSON ¶ added in v0.2.3
func (Null[T]) ValueOrZero ¶ added in v0.4.5
func (n Null[T]) ValueOrZero() T
ValueOrZero returns the inner value if valid, otherwise zero.
type NullDecimal ¶ added in v0.4.7
type NullDecimal = decimal.NullDecimal
type RawJSON ¶ added in v0.1.3
type RawJSON []byte
RawJSON same functionality with json.RawMessage and scan and value methods.
func (RawJSON) MarshalJSON ¶ added in v0.1.3
MarshalJSON returns m as the JSON encoding of m.
func (*RawJSON) UnmarshalJSON ¶ added in v0.1.3
UnmarshalJSON sets *m to a copy of data.
type Time ¶ added in v0.2.7
func (Time) MarshalJSON ¶ added in v0.2.7
func (*Time) UnmarshalJSON ¶ added in v0.2.7
Click to show internal directories.
Click to hide internal directories.