Documentation ¶
Overview ¶
Package null contains SQL types that consider zero input and null input as separate values, with convenient support for JSON and text marshaling. Types in this package will always encode to their null value if null. Use the zero subpackage if you want zero values and null to be treated the same.
Package null contains SQL types that consider zero input and null input as separate values, with convenient support for JSON and text marshaling. Types in this package will always encode to their null value if null. Use the zero subpackage if you want zero values and null to be treated the same.
Package null contains SQL types that consider zero input and null input as separate values, with convenient support for JSON and text marshaling. Types in this package will always encode to their null value if null. Use the zero subpackage if you want zero values and null to be treated the same.
Index ¶
- func IsArrayOfVals(data []byte) (bool, string)
- type Bool
- func (b Bool) Equal(other Bool) bool
- func (b Bool) IsZero() bool
- func (b Bool) MarshalJSON() ([]byte, error)
- func (b Bool) MarshalText() ([]byte, error)
- func (b Bool) Ptr() *bool
- func (b *Bool) Set(v bool)
- func (b *Bool) UnmarshalJSON(data []byte) error
- func (b *Bool) UnmarshalText(text []byte) error
- func (b Bool) ValueOrZero() bool
- type Date
- type DateSkipErr
- type Date_v2
- type Float
- func (f Float) Equal(other Float) bool
- func (f Float) IsZero() bool
- func (f Float) MarshalJSON() ([]byte, error)
- func (f Float) MarshalText() ([]byte, error)
- func (f Float) Ptr() *float64
- func (f *Float) Set(n float64)
- func (f *Float) UnmarshalJSON(data []byte) error
- func (f *Float) UnmarshalText(text []byte) error
- func (f Float) ValueOrZero() float64
- type Int
- func (i Int) Equal(other Int) bool
- func (i Int) IsZero() bool
- func (i Int) MarshalJSON() ([]byte, error)
- func (i Int) MarshalText() ([]byte, error)
- func (i Int) Ptr() *int64
- func (i *Int) Set(n int64)
- func (i *Int) UnmarshalJSON(data []byte) error
- func (i *Int) UnmarshalText(text []byte) error
- func (i Int) ValueOrZero() int64
- type String
- func (s String) Equal(other String) bool
- func (s String) IsZero() bool
- func (s String) MarshalJSON() ([]byte, error)
- func (s String) MarshalText() ([]byte, error)
- func (s String) Ptr() *string
- func (s *String) Scan(value interface{}) error
- func (s *String) Set(v string)
- func (s *String) UnmarshalJSON(data []byte) error
- func (s *String) UnmarshalText(text []byte) error
- func (s String) ValueOrZero() string
- type StringUnescapeHtml
- func (s StringUnescapeHtml) Equal(other StringUnescapeHtml) bool
- func (s StringUnescapeHtml) IsZero() bool
- func (s StringUnescapeHtml) MarshalJSON() ([]byte, error)
- func (s StringUnescapeHtml) MarshalText() ([]byte, error)
- func (s StringUnescapeHtml) Ptr() *string
- func (s *StringUnescapeHtml) Set(v string)
- func (s *StringUnescapeHtml) UnmarshalJSON(data []byte) error
- func (s *StringUnescapeHtml) UnmarshalText(text []byte) error
- func (s StringUnescapeHtml) ValueOrZero() string
- type String_win1251
- func (s String_win1251) Equal(other String_win1251) bool
- func (s String_win1251) IsZero() bool
- func (s String_win1251) MarshalJSON() ([]byte, error)
- func (s String_win1251) MarshalText() ([]byte, error)
- func (s String_win1251) Ptr() *string
- func (s *String_win1251) Scan(value interface{}) error
- func (s *String_win1251) Set(v string)
- func (s *String_win1251) UnmarshalJSON(data []byte) error
- func (s *String_win1251) UnmarshalText(text []byte) error
- func (s String_win1251) ValueOrZero() string
- type Time
- func (t Time) Equal(other Time) bool
- func (t Time) ExactEqual(other Time) bool
- func (t Time) IsZero() bool
- func (t Time) MarshalJSON() ([]byte, error)
- func (t Time) MarshalText() ([]byte, error)
- func (t Time) Ptr() *time.Time
- func (t *Time) Set(v time.Time)
- func (t *Time) UnmarshalJSON(data []byte) error
- func (t *Time) UnmarshalText(text []byte) error
- func (t Time) Value() (driver.Value, error)
- func (t Time) ValueOrZero() time.Time
- type TimeKatalogrek
- func (t TimeKatalogrek) Equal(other Time) bool
- func (t TimeKatalogrek) ExactEqual(other Time) bool
- func (t TimeKatalogrek) IsZero() bool
- func (t TimeKatalogrek) MarshalJSON() ([]byte, error)
- func (t TimeKatalogrek) MarshalText() ([]byte, error)
- func (t TimeKatalogrek) Ptr() *time.Time
- func (t *TimeKatalogrek) Set(v time.Time)
- func (t *TimeKatalogrek) UnmarshalJSON(data []byte) error
- func (t *TimeKatalogrek) UnmarshalText(text []byte) error
- func (t TimeKatalogrek) Value() (driver.Value, error)
- func (t TimeKatalogrek) ValueOrZero() time.Time
- type TimeSkipErr
- func (t TimeSkipErr) Equal(other Time) bool
- func (t TimeSkipErr) ExactEqual(other Time) bool
- func (t TimeSkipErr) IsZero() bool
- func (t TimeSkipErr) MarshalJSON() ([]byte, error)
- func (t TimeSkipErr) MarshalText() ([]byte, error)
- func (t TimeSkipErr) Ptr() *time.Time
- func (t *TimeSkipErr) Set(v time.Time)
- func (t *TimeSkipErr) UnmarshalJSON(data []byte) error
- func (t *TimeSkipErr) UnmarshalText(text []byte) error
- func (t TimeSkipErr) Value() (driver.Value, error)
- func (t TimeSkipErr) ValueOrZero() time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsArrayOfVals ¶ added in v1.0.15
Types ¶
type Bool ¶
Bool is a nullable bool. It does not consider false values to be null. It will decode to null, not false, if null.
func BoolFromPtr ¶
BoolFromPtr creates a new Bool that will be null if f is nil.
func (Bool) IsZero ¶
IsZero returns true for invalid Bools, for future omitempty support (Go 1.4?) A non-null Bool with a 0 value will not be considered zero.
func (Bool) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this Bool is null.
func (Bool) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string if this Bool is null.
func (Bool) Ptr ¶
Ptr returns a pointer to this Bool's value, or a nil pointer if this Bool is null.
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Bool.
func (*Bool) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null Bool if the input is blank. It will return an error if the input is not an integer, blank, or "null".
func (Bool) ValueOrZero ¶
ValueOrZero returns the inner value if valid, otherwise false.
type Date ¶
Date is a nullable Date. It supports SQL and JSON serialization. It will marshal to null if null.
func DateSkipErrFrom ¶ added in v1.0.20
DateFrom creates a new Time that will always be valid.
func NewDateSkipErr ¶ added in v1.0.20
NewDate creates a new Date.
func (*Date) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It has backwards compatibility with v3 in that the string "null" is considered equivalent to an empty string and unmarshaling will succeed. This may be removed in a future version.
type DateSkipErr ¶ added in v1.0.20
Date is a nullable Date. It supports SQL and JSON serialization. It will marshal to null if null.
func (*DateSkipErr) GetYear ¶ added in v1.0.20
func (t *DateSkipErr) GetYear() sql.NullInt64
func (*DateSkipErr) String ¶ added in v1.0.20
func (t *DateSkipErr) String() string
func (*DateSkipErr) UnmarshalText ¶ added in v1.0.20
func (t *DateSkipErr) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler. It has backwards compatibility with v3 in that the string "null" is considered equivalent to an empty string and unmarshaling will succeed. This may be removed in a future version.
type Date_v2 ¶ added in v1.0.5
Date is a nullable Date. It supports SQL and JSON serialization. It will marshal to null if null.
func Date_v2From ¶ added in v1.0.5
DateFrom creates a new Time that will always be valid.
func NewDate_v2 ¶ added in v1.0.5
NewDate creates a new Date.
func (*Date_v2) UnmarshalText ¶ added in v1.0.5
UnmarshalText implements encoding.TextUnmarshaler. It has backwards compatibility with v3 in that the string "null" is considered equivalent to an empty string and unmarshaling will succeed. This may be removed in a future version.
type Float ¶
type Float struct {
sql.NullFloat64
}
Float is a nullable float64. It does not consider zero values to be null. It will decode to null, not zero, if null.
func FloatFromPtr ¶
FloatFromPtr creates a new Float that be null if f is nil.
func FloatFromStr ¶ added in v1.0.3
func (Float) Equal ¶
Equal returns true if both floats have the same value or are both null. Warning: calculations using floating point numbers can result in different ways the numbers are stored in memory. Therefore, this function is not suitable to compare the result of a calculation. Use this method only to check if the value has changed in comparison to some previous value.
func (Float) IsZero ¶
IsZero returns true for invalid Floats, for future omitempty support (Go 1.4?) A non-null Float with a 0 value will not be considered zero.
func (Float) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this Float is null.
func (Float) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string if this Float is null.
func (Float) Ptr ¶
Ptr returns a pointer to this Float's value, or a nil pointer if this Float is null.
func (*Float) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Float.
func (*Float) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null Float if the input is blank. It will return an error if the input is not an integer, blank, or "null".
func (Float) ValueOrZero ¶
ValueOrZero returns the inner value if valid, otherwise zero.
type Int ¶
Int is an nullable int64. It does not consider zero values to be null. It will decode to null, not zero, if null.
func IntFromPtr ¶
IntFromPtr creates a new Int that be null if i is nil.
func IntFromStr ¶ added in v1.0.3
func (Int) IsZero ¶
IsZero returns true for invalid Ints, for future omitempty support (Go 1.4?) A non-null Int with a 0 value will not be considered zero.
func (Int) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this Int is null.
func (Int) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string if this Int is null.
func (*Int) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number, string, and null input. 0 will not be considered a null Int.
func (*Int) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null Int if the input is blank. It will return an error if the input is not an integer, blank, or "null".
func (Int) ValueOrZero ¶
ValueOrZero returns the inner value if valid, otherwise zero.
type String ¶
type String struct {
sql.NullString
}
String is a nullable string. It supports SQL and JSON serialization. It will marshal to null if null. Blank string input will be considered null.
func StringFrom ¶
StringFrom creates a new String that will never be blank.
func StringFromPtr ¶
StringFromPtr creates a new String that be null if s is nil.
func (String) IsZero ¶
IsZero returns true for null strings, for potential future omitempty support.
func (String) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this String is null.
func (String) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string when this String is null.
func (String) Ptr ¶
Ptr returns a pointer to this String's value, or a nil pointer if this String is null.
func (*String) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string and null input. Blank string input does not produce a null String.
func (*String) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null String if the input is a blank string.
func (String) ValueOrZero ¶
ValueOrZero returns the inner value if valid, otherwise zero.
type StringUnescapeHtml ¶ added in v1.0.6
type StringUnescapeHtml struct {
sql.NullString
}
Unmarshall html codes to cyrilic str e.g. КИРИЛЛ -> КИРИЛЛ String is a nullable string. It supports SQL and JSON serialization. It will marshal to null if null. Blank string input will be considered null.
func NewStringUnescapeHtml ¶ added in v1.0.6
func NewStringUnescapeHtml(s string, valid bool) StringUnescapeHtml
NewString creates a new String
func StringUnescapeHtmlFrom ¶ added in v1.0.6
func StringUnescapeHtmlFrom(s string) StringUnescapeHtml
StringFrom creates a new String that will never be blank.
func StringUnescapeHtmlFromPtr ¶ added in v1.0.6
func StringUnescapeHtmlFromPtr(s *string) StringUnescapeHtml
StringFromPtr creates a new String that be null if s is nil.
func (StringUnescapeHtml) Equal ¶ added in v1.0.6
func (s StringUnescapeHtml) Equal(other StringUnescapeHtml) bool
Equal returns true if both strings have the same value or are both null.
func (StringUnescapeHtml) IsZero ¶ added in v1.0.6
func (s StringUnescapeHtml) IsZero() bool
IsZero returns true for null strings, for potential future omitempty support.
func (StringUnescapeHtml) MarshalJSON ¶ added in v1.0.6
func (s StringUnescapeHtml) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. It will encode null if this StringUnescapeHtml is null.
func (StringUnescapeHtml) MarshalText ¶ added in v1.0.6
func (s StringUnescapeHtml) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler. It will encode a blank string when this StringUnescapeHtml is null.
func (StringUnescapeHtml) Ptr ¶ added in v1.0.6
func (s StringUnescapeHtml) Ptr() *string
Ptr returns a pointer to this StringUnescapeHtml's value, or a nil pointer if this StringUnescapeHtml is null.
func (*StringUnescapeHtml) Set ¶ added in v1.0.6
func (s *StringUnescapeHtml) Set(v string)
Set changes this StringUnescapeHtml's value and also sets it to be non-null.
func (*StringUnescapeHtml) UnmarshalJSON ¶ added in v1.0.6
func (s *StringUnescapeHtml) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler. It supports StringUnescapeHtml and null input. Blank string input does not produce a null String.
func (*StringUnescapeHtml) UnmarshalText ¶ added in v1.0.6
func (s *StringUnescapeHtml) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null String if the input is a blank string.
func (StringUnescapeHtml) ValueOrZero ¶ added in v1.0.6
func (s StringUnescapeHtml) ValueOrZero() string
ValueOrZero returns the inner value if valid, otherwise zero.
type String_win1251 ¶ added in v1.0.15
type String_win1251 struct {
sql.NullString
}
String is a nullable string. It supports SQL and JSON serialization. It will marshal to null if null. Blank string input will be considered null.
func NewString_win1251 ¶ added in v1.0.15
func NewString_win1251(s string, valid bool) String_win1251
NewString creates a new String
func StringFromPtr_win1251 ¶ added in v1.0.15
func StringFromPtr_win1251(s *string) String_win1251
StringFromPtr creates a new String that be null if s is nil.
func String_win1251From ¶ added in v1.0.15
func String_win1251From(s string) String_win1251
StringFrom creates a new String that will never be blank.
func (String_win1251) Equal ¶ added in v1.0.15
func (s String_win1251) Equal(other String_win1251) bool
Equal returns true if both strings have the same value or are both null.
func (String_win1251) IsZero ¶ added in v1.0.15
func (s String_win1251) IsZero() bool
IsZero returns true for null strings, for potential future omitempty support.
func (String_win1251) MarshalJSON ¶ added in v1.0.15
func (s String_win1251) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. It will encode null if this String is null.
func (String_win1251) MarshalText ¶ added in v1.0.15
func (s String_win1251) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler. It will encode a blank string when this String is null.
func (String_win1251) Ptr ¶ added in v1.0.15
func (s String_win1251) Ptr() *string
Ptr returns a pointer to this String's value, or a nil pointer if this String is null.
func (*String_win1251) Scan ¶ added in v1.0.15
func (s *String_win1251) Scan(value interface{}) error
Scan implements the Scanner interface for NullString
func (*String_win1251) Set ¶ added in v1.0.15
func (s *String_win1251) Set(v string)
Set changes this String's value and also sets it to be non-null.
func (*String_win1251) UnmarshalJSON ¶ added in v1.0.15
func (s *String_win1251) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler. It supports string and null input. Blank string input does not produce a null String.
func (*String_win1251) UnmarshalText ¶ added in v1.0.15
func (s *String_win1251) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null String if the input is a blank string.
func (String_win1251) ValueOrZero ¶ added in v1.0.15
func (s String_win1251) ValueOrZero() string
ValueOrZero returns the inner value if valid, otherwise zero.
type Time ¶
Time is a nullable time.Time. It supports SQL and JSON serialization. It will marshal to null if null.
func NewTimeSkipErr ¶ added in v1.0.18
NewTime creates a new Time.
func TimeFromPtr ¶
TimeFromPtr creates a new Time that will be null if t is nil.
func TimeSkipErrFrom ¶ added in v1.0.18
TimeFrom creates a new Time that will always be valid.
func TimeSkipErrFromPtr ¶ added in v1.0.18
TimeFromPtr creates a new Time that will be null if t is nil.
func (Time) Equal ¶
Equal returns true if both Time objects encode the same time or are both null. Two times can be equal even if they are in different locations. For example, 6:00 +0200 CEST and 4:00 UTC are Equal.
func (Time) ExactEqual ¶
ExactEqual returns true if both Time objects are equal or both null. ExactEqual returns false for times that are in different locations or have a different monotonic clock reading.
func (Time) IsZero ¶
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (Time) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (Time) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It returns an empty string if invalid, otherwise time.Time's MarshalText.
func (Time) Ptr ¶
Ptr returns a pointer to this Time's value, or a nil pointer if this Time is null.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string and null input.
func (*Time) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It has backwards compatibility with v3 in that the string "null" is considered equivalent to an empty string and unmarshaling will succeed. This may be removed in a future version.
func (Time) ValueOrZero ¶
ValueOrZero returns the inner value if valid, otherwise zero.
type TimeKatalogrek ¶ added in v1.0.22
Time is a nullable time.Time. It supports SQL and JSON serialization. It will marshal to null if null.
func NewTimeKatalogrek ¶ added in v1.0.22
func NewTimeKatalogrek(t time.Time, valid bool) TimeKatalogrek
NewTime creates a new Time.
func TimeKatalogrekFrom ¶ added in v1.0.22
func TimeKatalogrekFrom(t time.Time) TimeKatalogrek
TimeFrom creates a new Time that will always be valid.
func TimeKatalogrekFromPtr ¶ added in v1.0.22
func TimeKatalogrekFromPtr(t *time.Time) TimeKatalogrek
TimeFromPtr creates a new Time that will be null if t is nil.
func (TimeKatalogrek) Equal ¶ added in v1.0.22
func (t TimeKatalogrek) Equal(other Time) bool
Equal returns true if both Time objects encode the same time or are both null. Two times can be equal even if they are in different locations. For example, 6:00 +0200 CEST and 4:00 UTC are Equal.
func (TimeKatalogrek) ExactEqual ¶ added in v1.0.22
func (t TimeKatalogrek) ExactEqual(other Time) bool
ExactEqual returns true if both Time objects are equal or both null. ExactEqual returns false for times that are in different locations or have a different monotonic clock reading.
func (TimeKatalogrek) IsZero ¶ added in v1.0.22
func (t TimeKatalogrek) IsZero() bool
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (TimeKatalogrek) MarshalJSON ¶ added in v1.0.22
func (t TimeKatalogrek) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (TimeKatalogrek) MarshalText ¶ added in v1.0.22
func (t TimeKatalogrek) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler. It returns an empty string if invalid, otherwise time.Time's MarshalText.
func (TimeKatalogrek) Ptr ¶ added in v1.0.22
func (t TimeKatalogrek) Ptr() *time.Time
Ptr returns a pointer to this Time's value, or a nil pointer if this Time is null.
func (*TimeKatalogrek) Set ¶ added in v1.0.22
func (t *TimeKatalogrek) Set(v time.Time)
Set changes this Time's value and sets it to be non-null.
func (*TimeKatalogrek) UnmarshalJSON ¶ added in v1.0.22
func (t *TimeKatalogrek) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler. It supports string and null input.
func (*TimeKatalogrek) UnmarshalText ¶ added in v1.0.22
func (t *TimeKatalogrek) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler. It has backwards compatibility with v3 in that the string "null" is considered equivalent to an empty string and unmarshaling will succeed. This may be removed in a future version.
func (TimeKatalogrek) Value ¶ added in v1.0.22
func (t TimeKatalogrek) Value() (driver.Value, error)
Value implements the driver Valuer interface.
func (TimeKatalogrek) ValueOrZero ¶ added in v1.0.22
func (t TimeKatalogrek) ValueOrZero() time.Time
ValueOrZero returns the inner value if valid, otherwise zero.
type TimeSkipErr ¶ added in v1.0.18
Time is a nullable time.Time. It supports SQL and JSON serialization. It will marshal to null if null.
func (TimeSkipErr) Equal ¶ added in v1.0.18
func (t TimeSkipErr) Equal(other Time) bool
Equal returns true if both Time objects encode the same time or are both null. Two times can be equal even if they are in different locations. For example, 6:00 +0200 CEST and 4:00 UTC are Equal.
func (TimeSkipErr) ExactEqual ¶ added in v1.0.18
func (t TimeSkipErr) ExactEqual(other Time) bool
ExactEqual returns true if both Time objects are equal or both null. ExactEqual returns false for times that are in different locations or have a different monotonic clock reading.
func (TimeSkipErr) IsZero ¶ added in v1.0.18
func (t TimeSkipErr) IsZero() bool
IsZero returns true for invalid Times, hopefully for future omitempty support. A non-null Time with a zero value will not be considered zero.
func (TimeSkipErr) MarshalJSON ¶ added in v1.0.18
func (t TimeSkipErr) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (TimeSkipErr) MarshalText ¶ added in v1.0.18
func (t TimeSkipErr) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler. It returns an empty string if invalid, otherwise time.Time's MarshalText.
func (TimeSkipErr) Ptr ¶ added in v1.0.18
func (t TimeSkipErr) Ptr() *time.Time
Ptr returns a pointer to this Time's value, or a nil pointer if this Time is null.
func (*TimeSkipErr) Set ¶ added in v1.0.18
func (t *TimeSkipErr) Set(v time.Time)
Set changes this Time's value and sets it to be non-null.
func (*TimeSkipErr) UnmarshalJSON ¶ added in v1.0.18
func (t *TimeSkipErr) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler. It supports string and null input.
func (*TimeSkipErr) UnmarshalText ¶ added in v1.0.18
func (t *TimeSkipErr) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler. It has backwards compatibility with v3 in that the string "null" is considered equivalent to an empty string and unmarshaling will succeed. This may be removed in a future version.
func (TimeSkipErr) Value ¶ added in v1.0.18
func (t TimeSkipErr) Value() (driver.Value, error)
Value implements the driver Valuer interface.
func (TimeSkipErr) ValueOrZero ¶ added in v1.0.18
func (t TimeSkipErr) ValueOrZero() time.Time
ValueOrZero returns the inner value if valid, otherwise zero.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package zero contains SQL types that consider zero input and null input to be equivalent with convenient support for JSON and text marshaling.
|
Package zero contains SQL types that consider zero input and null input to be equivalent with convenient support for JSON and text marshaling. |