types

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package types provides nullable wrappers and not-null helpers for values that must travel through both database/sql and JSON.

Every wrapper implements sql.Scanner and driver.Valuer so the types can be used directly with sql.Row.Scan and db.Exec, and every wrapper implements json.Marshaler / json.Unmarshaler with a canonical shape: an invalid value marshals to null, a valid one to its documented string form (for example "2006-01-02" for Date/NullDate). Each type exposes an IsEmpty method (see Emptiable) and a ToString method (see ToStringAble) that returns "" when the value is NULL.

The package is organised around pairs that share a single serializer/parser:

  • Date / NullDate — calendar date ("2006-01-02" or "02.01.2006" on input; always "2006-01-02" on output).
  • LocalDateTime / NullLocalDateTime — wall-clock date-time without a timezone ("2006-01-02T15:04:05[.fff…]").
  • OffsetDateTime / NullOffsetDateTime — date-time with an offset ("2006-01-02T15:04:05[.fff…]Z" or "±HH:MM").
  • LocalTime / NullLocalTime — wall-clock time of day without a timezone ("15:04:05[.fff…]").
  • OffsetTime / NullOffsetTime — time of day with an offset ("15:04:05[.fff…]Z" or "±HH:MM").

Additional nullable wrappers cover primitive types: NullString, NullBool, NullInt16/32/64, NullFloat, NullDecimal and NullUUID.

Nullable types accept the JSON token null on UnmarshalJSON and SQL NULL on Scan; their not-null counterparts reject both. Scan delegates to the corresponding sql.Null* wrapper so that typed nils from database drivers are honoured.

Index

Constants

View Source
const RuOnlyDateMask = "02.01.2006"

RuOnlyDateMask is the dd.MM.yyyy locale date format accepted by parseDate in addition to ISO 8601 (time.DateOnly).

Variables

This section is empty.

Functions

func AssembleDateTime

func AssembleDateTime(
	dateValue *time.Time,
	timeValue *time.Time,
	location *time.Location,
) *time.Time

AssembleDateTime combines the calendar date from dateValue with the wall-clock components from timeValue. If location is non-nil it is used as the resulting time.Location, otherwise timeValue's location is kept.

func AssembleDateTimeTZ

func AssembleDateTimeTZ(
	dateValue *time.Time,
	timeValue *time.Time,
	timeZone string,
) (*time.Time, error)

AssembleDateTimeTZ combines dateValue and timeValue and resolves the resulting location from the textual timeZone using ParseTimezoneExtended (IANA names, "Z", and "+HH:MM" / "+HHMM" offsets are all accepted). On a zone parse error the original dateValue is returned alongside the error.

func AssembleNullDateTimeTZ

func AssembleNullDateTimeTZ(
	dateValue *NullDate,
	defaultDate *time.Time,
	timeValue *NullOffsetTime,
	defaultTime *time.Time,
	timeZone string,
) (*time.Time, error)

AssembleNullDateTimeTZ is the NULL-aware variant of AssembleDateTimeTZ. A NULL date or time is replaced by the corresponding default (defaultDate / defaultTime); the returned pointer reflects the assembled instant in the zone decoded from timeZone.

func DateTimeToString

func DateTimeToString(t time.Time) string

DateTimeToString renders a datetime in the library's canonical TZ-aware format. Kept as a thin wrapper for callers that operate on bare time.Time values.

func DateToString

func DateToString(date time.Time) string

DateToString renders a calendar date in the library's canonical ISO 8601 form ("2006-01-02").

func GetNullString

func GetNullString(s sql.NullString) string

GetNullString returns the underlying string of an sql.NullString, or "" when the value is NULL. Mirrors NSFromString on the read side.

func IsEmpty

func IsEmpty(t interface{}) bool

IsEmpty reports whether v should be treated as empty/NULL. It accepts nil, primitives, the standard library's sql.Null* family, and any value that implements Emptiable (including pointer-receiver implementations invoked on a value).

func MaxDateTime

func MaxDateTime(dt1, dt2 time.Time) time.Time

MaxDateTime returns the later of dt1 and dt2. Ties return dt2.

func MinDateTime

func MinDateTime(dt1, dt2 time.Time) time.Time

MinDateTime returns the earlier of dt1 and dt2. Ties return dt2.

func NSFromString

func NSFromString(s string) sql.NullString

NSFromString builds an sql.NullString from a raw string, treating the empty string as NULL. Handy when composing queries against the database/sql package directly.

func ParseDateFromString

func ParseDateFromString(strValue string) (*time.Time, error)

ParseDateFromString parses a calendar date from a string using the formats supported by the library (ISO 8601 and dd.MM.yyyy). The returned pointer is never nil on success.

func ParseDateTimeFromString

func ParseDateTimeFromString(strValue string) (*time.Time, error)

ParseDateTimeFromString parses a datetime string. The date and time parts must be separated by either 'T' or ' '. The time part may carry an optional timezone designator ("Z", "+HH:MM", "+HHMM").

func ParseTimeFromString

func ParseTimeFromString(strValue string) (*time.Time, error)

ParseTimeFromString parses a time-of-day with an optional timezone designator ("HH:MM[:SS[.fff…]][Z|±HH:MM|±HHMM]").

func ParseTimezoneExtended

func ParseTimezoneExtended(strValue string) (*time.Location, string, error)

ParseTimezoneExtended attempts to extract a trailing timezone designator from strValue. Supported forms are "Z" (RFC 3339 UTC literal), "+HH:MM" / "-HH:MM" (six chars) and "+HHMM" / "-HHMM" (five chars). When a designator is found it is removed from the returned string and represented as a *time.Location; otherwise time.Local is returned.

func ToString

func ToString(val interface{}) string

ToString renders v using its ToString method when available (including pointer-receiver implementations invoked on a value), and falls back to fmt.Sprintf("%v", ...) otherwise.

Types

type Date

type Date time.Time

Date is a not-null calendar date (no time component, no timezone).

Date shares its serializer with NullDate: both render as "2006-01-02" and accept the same parser inputs (ISO 8601 and dd.MM.yyyy). Use Date for required JSON or SQL fields where NULL is not permitted; use NullDate for optional ones.

In(loc) and UTC() are not provided by design: Date is a calendar concept without a time-of-day, so zone reinterpretation is meaningless. Use OffsetDateTime if a zone-aware instant is required.

func DateFromString

func DateFromString(strValue string) (Date, error)

DateFromString parses a calendar date using the formats supported by the library (ISO 8601 and dd.MM.yyyy).

func NewDate

func NewDate(t time.Time) Date

NewDate wraps t as a Date. The time-of-day component is preserved on the underlying value but is dropped by the serializer (formatDate writes only "YYYY-MM-DD").

func (Date) Add added in v0.3.0

func (thisVal Date) Add(d time.Duration) Date

Add returns the date shifted by d. Sub-day components of d are applied to the underlying time.Time but do not surface in the serialised form (Date renders only YYYY-MM-DD).

func (Date) AddDate added in v0.3.0

func (thisVal Date) AddDate(years, months, days int) Date

AddDate returns the date with the given number of years, months, and days added.

func (Date) After added in v0.3.0

func (thisVal Date) After(other Date) bool

After reports whether thisVal is after other.

func (Date) AsTime

func (thisVal Date) AsTime() time.Time

AsTime returns the underlying time.Time.

func (Date) Before added in v0.3.0

func (thisVal Date) Before(other Date) bool

Before reports whether thisVal precedes other.

func (Date) Compare added in v0.3.0

func (thisVal Date) Compare(other Date) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other.

func (Date) Day added in v0.3.0

func (thisVal Date) Day() int

Day returns the day of the month (1-31).

func (Date) Equal added in v0.3.0

func (thisVal Date) Equal(other Date) bool

Equal reports whether thisVal and other denote the same instant.

func (Date) MarshalJSON

func (thisVal Date) MarshalJSON() ([]byte, error)

MarshalJSON renders the date as a JSON string in the library's canonical format ("2006-01-02").

func (Date) Month added in v0.3.0

func (thisVal Date) Month() time.Month

Month returns the calendar month (1-based, time.January..December).

func (*Date) Scan

func (thisVal *Date) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface. A NULL value is rejected — Date cannot be empty.

func (Date) Sub added in v0.3.0

func (thisVal Date) Sub(other Date) time.Duration

Sub returns the duration thisVal − other. Convert to days via `dur / (24 * time.Hour)` if needed.

func (Date) ToString

func (thisVal Date) ToString() string

ToString renders the date in the library's canonical format ("2006-01-02").

func (Date) Unix added in v0.3.0

func (thisVal Date) Unix() int64

Unix returns the underlying instant as a Unix timestamp (seconds since 1970-01-01 UTC). For Date values constructed at midnight UTC this is the conventional "date as epoch seconds".

func (Date) UnixMicro added in v0.3.0

func (thisVal Date) UnixMicro() int64

UnixMicro returns the underlying instant as microseconds since 1970-01-01 UTC.

func (Date) UnixMilli added in v0.3.0

func (thisVal Date) UnixMilli() int64

UnixMilli returns the underlying instant as milliseconds since 1970-01-01 UTC.

func (Date) UnixNano added in v0.3.0

func (thisVal Date) UnixNano() int64

UnixNano returns the underlying instant as nanoseconds since 1970-01-01 UTC.

func (*Date) UnmarshalJSON

func (thisVal *Date) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string in any of the formats accepted by DateFromString. JSON null is rejected — Date cannot be empty.

func (Date) Value

func (thisVal Date) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

func (Date) Year added in v0.3.0

func (thisVal Date) Year() int

Year returns the calendar year.

func (Date) YearDay added in v0.3.0

func (thisVal Date) YearDay() int

YearDay returns the day-of-year (1-365 / 1-366 in leap years).

type Emptiable

type Emptiable interface {
	IsEmpty() bool
}

Emptiable is the interface implemented by every nullable type in the package. IsEmpty reports whether the value is missing (NULL).

type LocalDateTime

type LocalDateTime struct {
	Year    int
	Month   time.Month
	Day     int
	Hour    int
	Minute  int
	Second  int
	Nanosec int
}

LocalDateTime is a not-null wall-clock datetime without a timezone.

Use LocalDateTime for business events anchored to a calendar moment in a human's wall-clock time (e.g. "contract signed on 2026-04-18 at 13:00") where the offset is intentionally absent. For points in time with a known offset, use OffsetDateTime instead.

In(loc) and UTC() are not provided by design: LocalDateTime carries no timezone, so zone reinterpretation is meaningless. Use ToTime(loc) to materialise a time.Time in a chosen zone.

func LocalDateTimeFromString

func LocalDateTimeFromString(strValue string) (LocalDateTime, error)

LocalDateTimeFromString parses a wall-clock datetime in either ISO 8601 "T" form ("2006-01-02T15:04:05[.fff]") or the equivalent space-separated form. Inputs carrying a timezone designator are rejected.

func LocalDateTimeFromTime

func LocalDateTimeFromTime(t time.Time) LocalDateTime

LocalDateTimeFromTime extracts the wall-clock components of t and discards its location.

func NewLocalDateTime

func NewLocalDateTime(year int, month time.Month, day, hour, minute, second, nanosec int) LocalDateTime

NewLocalDateTime constructs a LocalDateTime from its components.

func (LocalDateTime) Add added in v0.3.0

func (thisVal LocalDateTime) Add(d time.Duration) LocalDateTime

Add returns thisVal shifted by d on the wall-clock components.

func (LocalDateTime) AddDate added in v0.3.0

func (thisVal LocalDateTime) AddDate(years, months, days int) LocalDateTime

AddDate returns thisVal with the given years/months/days added.

func (LocalDateTime) After added in v0.3.0

func (thisVal LocalDateTime) After(other LocalDateTime) bool

After reports whether thisVal is after other.

func (LocalDateTime) Before added in v0.3.0

func (thisVal LocalDateTime) Before(other LocalDateTime) bool

Before reports whether thisVal precedes other. Comparison operates on wall-clock components (year/month/.../nanosec) since LocalDateTime carries no timezone.

func (LocalDateTime) Compare added in v0.3.0

func (thisVal LocalDateTime) Compare(other LocalDateTime) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other.

func (LocalDateTime) Equal added in v0.3.0

func (thisVal LocalDateTime) Equal(other LocalDateTime) bool

Equal reports whether thisVal and other have identical wall-clock components.

func (LocalDateTime) MarshalJSON

func (thisVal LocalDateTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in the library's canonical format.

func (*LocalDateTime) Scan

func (thisVal *LocalDateTime) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface. A NULL value is rejected — LocalDateTime cannot be empty.

func (LocalDateTime) Sub added in v0.3.0

func (thisVal LocalDateTime) Sub(other LocalDateTime) time.Duration

Sub returns thisVal − other as a time.Duration on the wall-clock components.

func (LocalDateTime) ToString

func (thisVal LocalDateTime) ToString() string

ToString renders the value in the library's canonical format ("2006-01-02T15:04:05[.fff]").

func (LocalDateTime) ToTime

func (thisVal LocalDateTime) ToTime(loc *time.Location) time.Time

ToTime materialises the wall-clock components in the given location. Pass time.UTC, time.Local, or a fixed zone according to how the value should be interpreted at the boundary with timezone-aware code. A nil loc is treated as time.UTC.

func (LocalDateTime) Truncate added in v0.3.0

func (thisVal LocalDateTime) Truncate(d time.Duration) LocalDateTime

Truncate returns thisVal rounded down to the nearest multiple of d since the zero time.

func (*LocalDateTime) UnmarshalJSON

func (thisVal *LocalDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string in any of the formats accepted by LocalDateTimeFromString. JSON null is rejected — LocalDateTime cannot be empty.

func (LocalDateTime) Value

func (thisVal LocalDateTime) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. The value is emitted in time.UTC; the SQL column type should be TIMESTAMP WITHOUT TIME ZONE so the driver writes the wall-clock fields verbatim.

func (LocalDateTime) YearDay added in v0.3.0

func (thisVal LocalDateTime) YearDay() int

YearDay returns the day-of-year (1-365 / 1-366 in leap years). Year/Month/Day/Hour/Minute/Second/Nanosec are exposed as struct fields directly.

type LocalTime

type LocalTime struct {
	Hour    int
	Minute  int
	Second  int
	Nanosec int
}

LocalTime is a not-null wall-clock time-of-day without a timezone.

Use LocalTime for values like "shop opens at 09:00" — a time-of-day with no offset. For points in time with a known offset, use OffsetTime instead.

In(loc) and UTC() are not provided by design: LocalTime carries no timezone, so zone reinterpretation is meaningless. Use ToTime() to materialise a time.Time on the zero date in UTC.

func LocalTimeFromString

func LocalTimeFromString(strValue string) (LocalTime, error)

LocalTimeFromString parses a wall-clock time-of-day in ISO 8601 form ("HH:MM[:SS[.fff]]"). Inputs carrying a timezone designator are rejected.

func LocalTimeFromTime

func LocalTimeFromTime(t time.Time) LocalTime

LocalTimeFromTime extracts the time-of-day components of t and discards its date and location.

func NewLocalTime

func NewLocalTime(hour, minute, second, nanosec int) LocalTime

NewLocalTime constructs a LocalTime from its components.

func (LocalTime) Add added in v0.3.0

func (thisVal LocalTime) Add(d time.Duration) LocalTime

Add returns thisVal shifted by d. No modulo-24h enforcement: a duration that crosses midnight rotates the implicit date in the underlying time.Time, but the date is not part of LocalTime's serialised form. Consume with care.

func (LocalTime) After added in v0.3.0

func (thisVal LocalTime) After(other LocalTime) bool

After reports whether thisVal is after other.

func (LocalTime) Before added in v0.3.0

func (thisVal LocalTime) Before(other LocalTime) bool

Before reports whether thisVal precedes other. Comparison operates on wall-clock components (hour/minute/second/nanosec) since LocalTime carries no timezone.

func (LocalTime) Compare added in v0.3.0

func (thisVal LocalTime) Compare(other LocalTime) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other.

func (LocalTime) Equal added in v0.3.0

func (thisVal LocalTime) Equal(other LocalTime) bool

Equal reports whether thisVal and other have identical wall-clock components.

func (LocalTime) MarshalJSON

func (thisVal LocalTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in the library's canonical format.

func (*LocalTime) Scan

func (thisVal *LocalTime) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface. Accepts time.Time, string, or []byte. A NULL value is rejected — LocalTime cannot be empty.

func (LocalTime) Sub added in v0.3.0

func (thisVal LocalTime) Sub(other LocalTime) time.Duration

Sub returns thisVal − other as a time.Duration. The implicit dates participate in the calculation; for same-day pairs the result is sub-24h.

func (LocalTime) ToString

func (thisVal LocalTime) ToString() string

ToString renders the value in the library's canonical format ("15:04:05[.fff]").

func (LocalTime) ToTime

func (thisVal LocalTime) ToTime() time.Time

ToTime materialises the time-of-day on the zero date (year 0, January 1) in time.UTC.

func (LocalTime) Truncate added in v0.3.0

func (thisVal LocalTime) Truncate(d time.Duration) LocalTime

Truncate returns thisVal rounded down to the nearest multiple of d since the zero time.

func (*LocalTime) UnmarshalJSON

func (thisVal *LocalTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string in any of the formats accepted by LocalTimeFromString. JSON null is rejected — LocalTime cannot be empty.

func (LocalTime) Value

func (thisVal LocalTime) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. The value is emitted as a time.Time on the zero date in time.UTC.

type NullBool

type NullBool struct {
	Val   bool
	Valid bool
}

NullBool is a nullable boolean. Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullBool

func NewNullBool(value bool) NullBool

NewNullBool constructs a valid NullBool wrapping value.

func NewNullBoolEmpty

func NewNullBoolEmpty() NullBool

NewNullBoolEmpty returns an invalid (NULL) NullBool.

func NullBoolFromString

func NullBoolFromString(strValue *string) NullBool

NullBoolFromString parses a bool from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullBool.

func (*NullBool) IsEmpty

func (thisVal *NullBool) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullBool) IsZero

func (thisVal NullBool) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullBool) MarshalJSON

func (thisVal NullBool) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON boolean, or null when empty. The valid path returns a shared literal slice ("true"/"false") to skip the reflection dispatch and allocation that json.Marshal does for the primitive bool type.

func (*NullBool) Scan

func (thisVal *NullBool) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullBool so that the driver's NULL signalling is honoured.

func (NullBool) ToString

func (thisVal NullBool) ToString() string

ToString renders the value as "true"/"false", or "" when NULL.

func (*NullBool) UnmarshalJSON

func (thisVal *NullBool) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON boolean or the token null. Any other input is treated as a parse error.

func (NullBool) Value

func (thisVal NullBool) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil).

type NullDate

type NullDate struct {
	Val   Date
	Valid bool
}

NullDate is a nullable calendar date (year/month/day with no time-of-day or zone component). Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullDate

func NewNullDate(value Date) NullDate

NewNullDate constructs a valid NullDate wrapping value. Use NullDateFromTime when starting from a time.Time.

func NewNullDateEmpty

func NewNullDateEmpty() NullDate

NewNullDateEmpty returns an invalid (NULL) NullDate.

func NullDateFromString

func NullDateFromString(strValue *string) NullDate

NullDateFromString parses a date from the string pointer using the library's accepted formats (ISO 8601 "2006-01-02" and the Russian "dd.MM.yyyy"). A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullDate.

func NullDateFromTime added in v0.3.0

func NullDateFromTime(value time.Time) NullDate

NullDateFromTime constructs a valid NullDate from a time.Time. Equivalent to NewNullDate(Date(value)).

func (NullDate) Add added in v0.3.0

func (thisVal NullDate) Add(d time.Duration) NullDate

Add returns the date shifted by d. NULL propagates: an invalid receiver is returned unchanged.

func (NullDate) AddDate added in v0.3.0

func (thisVal NullDate) AddDate(years, months, days int) NullDate

AddDate returns the date with the given years/months/days added. NULL propagates.

func (NullDate) After added in v0.3.0

func (thisVal NullDate) After(other NullDate) bool

After reports whether thisVal is after other under sortable NULL semantics: NULL is never after any value (including another NULL).

func (NullDate) Before added in v0.3.0

func (thisVal NullDate) Before(other NullDate) bool

Before reports whether thisVal precedes other under sortable NULL semantics: NULL is strictly less than any valid value, two NULLs compare equal (so neither is Before the other).

func (NullDate) Compare added in v0.3.0

func (thisVal NullDate) Compare(other NullDate) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other under sortable NULL semantics: NULL precedes any valid value, two NULLs compare equal.

func (NullDate) Equal added in v0.3.0

func (thisVal NullDate) Equal(other NullDate) bool

Equal reports whether thisVal and other are equal under sortable NULL semantics: two NULLs are equal; NULL is never equal to a valid value.

func (*NullDate) IsEmpty

func (thisVal *NullDate) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullDate) IsZero

func (thisVal NullDate) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullDate) MarshalJSON

func (thisVal NullDate) MarshalJSON() ([]byte, error)

MarshalJSON renders the date as a JSON string in ISO 8601 form, or null when empty. The valid path writes directly to a single buffer via time.Time.AppendFormat, skipping the intermediate string and reflection dispatch that json.Marshal would perform.

func (*NullDate) Scan

func (thisVal *NullDate) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullTime so that the driver's NULL signalling is honoured.

func (NullDate) SubOk added in v0.3.0

func (thisVal NullDate) SubOk(other NullDate) (time.Duration, bool)

SubOk returns (thisVal − other, true) when both operands are valid, and (0, false) otherwise.

func (NullDate) ToString

func (thisVal NullDate) ToString() string

ToString renders the date in ISO 8601 form, or "" when NULL.

func (NullDate) UnixMicroOk added in v0.3.0

func (thisVal NullDate) UnixMicroOk() (int64, bool)

UnixMicroOk returns the microsecond-precision Unix timestamp and ok=true if the receiver is valid; (0, false) for NULL.

func (NullDate) UnixMilliOk added in v0.3.0

func (thisVal NullDate) UnixMilliOk() (int64, bool)

UnixMilliOk returns the millisecond-precision Unix timestamp and ok=true if the receiver is valid; (0, false) for NULL.

func (NullDate) UnixNanoOk added in v0.3.0

func (thisVal NullDate) UnixNanoOk() (int64, bool)

UnixNanoOk returns the nanosecond-precision Unix timestamp and ok=true if the receiver is valid; (0, false) for NULL.

func (NullDate) UnixOk added in v0.3.0

func (thisVal NullDate) UnixOk() (int64, bool)

UnixOk returns the underlying instant as a Unix timestamp (seconds since 1970-01-01 UTC) and ok=true if the receiver is valid; (0, false) for NULL.

func (*NullDate) UnmarshalJSON

func (thisVal *NullDate) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string using the accepted date formats (ISO 8601, dd.MM.yyyy) or the token null.

func (NullDate) Value

func (thisVal NullDate) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case is emitted as the underlying time.Time (drivers then format it as DATE).

type NullDecimal

type NullDecimal struct {
	Val   decimal.Decimal
	Valid bool
}

NullDecimal is a nullable arbitrary-precision decimal backed by github.com/shopspring/decimal. Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func MulNullDecimals

func MulNullDecimals(val1, val2 NullDecimal) NullDecimal

MulNullDecimals multiplies two NullDecimals. The result is NULL if either operand is NULL.

func NewNullDecimal

func NewNullDecimal(val decimal.Decimal) NullDecimal

NewNullDecimal constructs a valid NullDecimal wrapping val.

func NewNullDecimalEmpty

func NewNullDecimalEmpty() NullDecimal

NewNullDecimalEmpty returns an invalid (NULL) NullDecimal.

func NullDecimalFromString

func NullDecimalFromString(strValue *string) NullDecimal

NullDecimalFromString parses a decimal from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullDecimal.

func (*NullDecimal) IsEmpty

func (thisVal *NullDecimal) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullDecimal) IsZero

func (thisVal NullDecimal) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullDecimal) MarshalJSON

func (thisVal NullDecimal) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON number (the format decimal.Decimal itself emits), or null when empty.

func (*NullDecimal) Scan

func (thisVal *NullDecimal) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface. The decimal is received as text from the driver (via sql.NullString) and parsed through NullDecimalFromString so precision is preserved.

func (NullDecimal) ToString

func (thisVal NullDecimal) ToString() string

ToString renders the decimal via decimal.Decimal.String (no trailing zeros), or "" when NULL.

func (*NullDecimal) UnmarshalJSON

func (thisVal *NullDecimal) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON number, JSON string, or the token null. Any other input is treated as a parse error.

func (NullDecimal) Value

func (thisVal NullDecimal) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case delegates to decimal.Decimal.Value so full precision is preserved on the wire.

type NullFloat

type NullFloat struct {
	Val   float64
	Valid bool
}

NullFloat is a nullable float64. Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullFloat

func NewNullFloat(value float64) NullFloat

NewNullFloat constructs a valid NullFloat wrapping value.

func NewNullFloatEmpty

func NewNullFloatEmpty() NullFloat

NewNullFloatEmpty returns an invalid (NULL) NullFloat.

func NullFloatFromString

func NullFloatFromString(strValue *string) NullFloat

NullFloatFromString parses a float64 from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullFloat.

func (*NullFloat) IsEmpty

func (thisVal *NullFloat) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullFloat) IsZero

func (thisVal NullFloat) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullFloat) MarshalJSON

func (thisVal NullFloat) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON number, or null when empty. The valid path uses strconv.AppendFloat directly to skip the reflection dispatch and intermediate buffer allocation that json.Marshal does for primitive numeric types. The 'g' verb mirrors encoding/json's own format for float64.

func (*NullFloat) Scan

func (thisVal *NullFloat) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullFloat64 so that the driver's NULL signalling is honoured.

func (NullFloat) ToString

func (thisVal NullFloat) ToString() string

ToString renders the value via fmt's %f verb, or "" when NULL.

func (*NullFloat) UnmarshalJSON

func (thisVal *NullFloat) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON number or the token null. Any other input is treated as a parse error.

func (NullFloat) Value

func (thisVal NullFloat) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil).

type NullInt16

type NullInt16 struct {
	Val   int16
	Valid bool
}

NullInt16 is a nullable int16. Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullInt16

func NewNullInt16(value int16) NullInt16

NewNullInt16 constructs a valid NullInt16 wrapping value.

func NewNullInt16Empty

func NewNullInt16Empty() NullInt16

NewNullInt16Empty returns an invalid (NULL) NullInt16.

func NullInt16FromNullString

func NullInt16FromNullString(str NullString) NullInt16

NullInt16FromNullString parses an int16 from a NullString. An invalid or empty NullString, or a parse error, produce an invalid NullInt16.

func NullInt16FromString

func NullInt16FromString(strValue *string) NullInt16

NullInt16FromString parses an int16 from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullInt16.

func (*NullInt16) IsEmpty

func (thisVal *NullInt16) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullInt16) IsZero

func (thisVal NullInt16) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullInt16) MarshalJSON

func (thisVal NullInt16) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON number, or null when empty. The valid path uses strconv.AppendInt directly to skip the reflection dispatch and intermediate buffer allocation that json.Marshal does for primitive numeric types.

func (*NullInt16) Scan

func (thisVal *NullInt16) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullInt16 so that the driver's NULL signalling is honoured.

func (NullInt16) ToString

func (thisVal NullInt16) ToString() string

ToString renders the value in decimal form, or "" when NULL.

func (*NullInt16) UnmarshalJSON

func (thisVal *NullInt16) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON number or the token null. Any other input is treated as a parse error.

func (NullInt16) Value

func (thisVal NullInt16) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case is widened to int64 per the database/sql contract.

type NullInt32

type NullInt32 struct {
	Val   int32
	Valid bool
}

NullInt32 is a nullable int32. Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullInt32

func NewNullInt32(value int32) NullInt32

NewNullInt32 constructs a valid NullInt32 wrapping value.

func NewNullInt32Empty

func NewNullInt32Empty() NullInt32

NewNullInt32Empty returns an invalid (NULL) NullInt32.

func NullInt32FromNullString

func NullInt32FromNullString(str NullString) NullInt32

NullInt32FromNullString parses an int32 from a NullString. An invalid or empty NullString, or a parse error, produce an invalid NullInt32.

func NullInt32FromString

func NullInt32FromString(strValue *string) NullInt32

NullInt32FromString parses an int32 from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullInt32.

func (*NullInt32) IsEmpty

func (thisVal *NullInt32) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullInt32) IsZero

func (thisVal NullInt32) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullInt32) MarshalJSON

func (thisVal NullInt32) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON number, or null when empty. The valid path uses strconv.AppendInt directly to skip the reflection dispatch and intermediate buffer allocation that json.Marshal does for primitive numeric types.

func (*NullInt32) Scan

func (thisVal *NullInt32) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullInt32 so that the driver's NULL signalling is honoured.

func (NullInt32) ToString

func (thisVal NullInt32) ToString() string

ToString renders the value in decimal form, or "" when NULL.

func (*NullInt32) UnmarshalJSON

func (thisVal *NullInt32) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON number or the token null. Any other input is treated as a parse error.

func (NullInt32) Value

func (thisVal NullInt32) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case is widened to int64 per the database/sql contract.

type NullInt64

type NullInt64 struct {
	Val   int64
	Valid bool
}

NullInt64 is a nullable int64. Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullInt64

func NewNullInt64(value int64) NullInt64

NewNullInt64 constructs a valid NullInt64 wrapping value.

func NewNullInt64Empty

func NewNullInt64Empty() NullInt64

NewNullInt64Empty returns an invalid (NULL) NullInt64.

func NullInt64FromNullString

func NullInt64FromNullString(str NullString) NullInt64

NullInt64FromNullString parses an int64 from a NullString. An invalid or empty NullString, or a parse error, produce an invalid NullInt64.

func NullInt64FromString

func NullInt64FromString(strValue *string) NullInt64

NullInt64FromString parses an int64 from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullInt64.

func (*NullInt64) IsEmpty

func (thisVal *NullInt64) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullInt64) IsZero

func (thisVal NullInt64) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullInt64) MarshalJSON

func (thisVal NullInt64) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON number, or null when empty. The valid path uses strconv.AppendInt directly to skip the reflection dispatch and intermediate buffer allocation that json.Marshal does for primitive numeric types.

func (*NullInt64) Scan

func (thisVal *NullInt64) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullInt64 so that the driver's NULL signalling is honoured.

func (NullInt64) ToString

func (thisVal NullInt64) ToString() string

ToString renders the value in decimal form, or "" when NULL.

func (*NullInt64) UnmarshalJSON

func (thisVal *NullInt64) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON number or the token null. Any other input is treated as a parse error.

func (NullInt64) Value

func (thisVal NullInt64) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil).

type NullLocalDateTime

type NullLocalDateTime struct {
	Val   LocalDateTime
	Valid bool
}

NullLocalDateTime is the nullable counterpart of LocalDateTime. It shares the same serializer (formatLocalDateTime / parseLocalDateTime). Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullLocalDateTime

func NewNullLocalDateTime(value LocalDateTime) NullLocalDateTime

NewNullLocalDateTime constructs a valid NullLocalDateTime wrapping value. Use NullLocalDateTimeFromTime when starting from a time.Time.

func NewNullLocalDateTimeEmpty

func NewNullLocalDateTimeEmpty() NullLocalDateTime

NewNullLocalDateTimeEmpty returns an invalid (NULL) NullLocalDateTime.

func NullLocalDateTimeFromString

func NullLocalDateTimeFromString(strValue *string) NullLocalDateTime

NullLocalDateTimeFromString parses a local datetime from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullLocalDateTime.

func NullLocalDateTimeFromTime added in v0.3.0

func NullLocalDateTimeFromTime(value time.Time) NullLocalDateTime

NullLocalDateTimeFromTime constructs a valid NullLocalDateTime from a time.Time. The time-of-day fields are read in t's current location; the zone itself is dropped (LocalDateTime carries no zone by design).

func (NullLocalDateTime) Add added in v0.3.0

Add returns thisVal shifted by d. NULL propagates.

func (NullLocalDateTime) AddDate added in v0.3.0

func (thisVal NullLocalDateTime) AddDate(years, months, days int) NullLocalDateTime

AddDate returns thisVal with the given years/months/days added. NULL propagates.

func (NullLocalDateTime) After added in v0.3.0

func (thisVal NullLocalDateTime) After(other NullLocalDateTime) bool

After reports whether thisVal is after other under sortable NULL semantics: NULL is never after any value (including another NULL).

func (NullLocalDateTime) Before added in v0.3.0

func (thisVal NullLocalDateTime) Before(other NullLocalDateTime) bool

Before reports whether thisVal precedes other under sortable NULL semantics: NULL is strictly less than any valid value, two NULLs compare equal (so neither is Before the other).

func (NullLocalDateTime) Compare added in v0.3.0

func (thisVal NullLocalDateTime) Compare(other NullLocalDateTime) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other under sortable NULL semantics.

func (NullLocalDateTime) Equal added in v0.3.0

func (thisVal NullLocalDateTime) Equal(other NullLocalDateTime) bool

Equal reports whether thisVal and other are equal under sortable NULL semantics: two NULLs are equal; NULL is never equal to a valid value.

func (*NullLocalDateTime) IsEmpty

func (thisVal *NullLocalDateTime) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullLocalDateTime) IsZero

func (thisVal NullLocalDateTime) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullLocalDateTime) MarshalJSON

func (thisVal NullLocalDateTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in canonical local datetime form, or null when empty. The valid path appends directly into a single buffer via time.Time.AppendFormat, skipping the intermediate string and reflection dispatch that json.Marshal(formatLocalDateTime(...)) would perform.

func (*NullLocalDateTime) Scan

func (thisVal *NullLocalDateTime) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullTime so that the driver's NULL signalling is honoured. The returned time's wall-clock components are preserved verbatim.

func (NullLocalDateTime) SubOk added in v0.3.0

func (thisVal NullLocalDateTime) SubOk(other NullLocalDateTime) (time.Duration, bool)

SubOk returns (thisVal − other, true) when both operands are valid, and (0, false) otherwise.

func (NullLocalDateTime) ToString

func (thisVal NullLocalDateTime) ToString() string

ToString renders the value in the library's canonical local datetime form, or "" when NULL.

func (NullLocalDateTime) Truncate added in v0.3.0

func (thisVal NullLocalDateTime) Truncate(d time.Duration) NullLocalDateTime

Truncate returns thisVal rounded down to the nearest multiple of d since the zero time. NULL propagates.

func (*NullLocalDateTime) UnmarshalJSON

func (thisVal *NullLocalDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string containing a local datetime, or the token null. Any other input is treated as a parse error.

func (NullLocalDateTime) Value

func (thisVal NullLocalDateTime) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case is materialised as a time.Time in UTC (drivers interpret TIMESTAMP WITHOUT TIME ZONE as the wall-clock components).

type NullLocalTime

type NullLocalTime struct {
	Val   LocalTime
	Valid bool
}

NullLocalTime is the nullable counterpart of LocalTime. It shares the same serializer (formatLocalTime / parseLocalTime). Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullLocalTime

func NewNullLocalTime(value LocalTime) NullLocalTime

NewNullLocalTime constructs a valid NullLocalTime wrapping value. Use NullLocalTimeFromTime when starting from a time.Time.

func NewNullLocalTimeEmpty

func NewNullLocalTimeEmpty() NullLocalTime

NewNullLocalTimeEmpty returns an invalid (NULL) NullLocalTime.

func NullLocalTimeFromString

func NullLocalTimeFromString(strValue *string) NullLocalTime

NullLocalTimeFromString parses a local time from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullLocalTime.

func NullLocalTimeFromTime added in v0.3.0

func NullLocalTimeFromTime(value time.Time) NullLocalTime

NullLocalTimeFromTime constructs a valid NullLocalTime from a time.Time. The wall-clock fields are read in t's current location; the zone itself is dropped (LocalTime carries no zone by design).

func (NullLocalTime) Add added in v0.3.0

func (thisVal NullLocalTime) Add(d time.Duration) NullLocalTime

Add returns thisVal shifted by d. NULL propagates. No modulo-24h enforcement — see LocalTime.Add.

func (NullLocalTime) After added in v0.3.0

func (thisVal NullLocalTime) After(other NullLocalTime) bool

After reports whether thisVal is after other under sortable NULL semantics: NULL is never after any value (including another NULL).

func (NullLocalTime) Before added in v0.3.0

func (thisVal NullLocalTime) Before(other NullLocalTime) bool

Before reports whether thisVal precedes other under sortable NULL semantics: NULL is strictly less than any valid value, two NULLs compare equal (so neither is Before the other).

func (NullLocalTime) Compare added in v0.3.0

func (thisVal NullLocalTime) Compare(other NullLocalTime) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other under sortable NULL semantics.

func (NullLocalTime) Equal added in v0.3.0

func (thisVal NullLocalTime) Equal(other NullLocalTime) bool

Equal reports whether thisVal and other are equal under sortable NULL semantics: two NULLs are equal; NULL is never equal to a valid value.

func (*NullLocalTime) IsEmpty

func (thisVal *NullLocalTime) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullLocalTime) IsZero

func (thisVal NullLocalTime) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullLocalTime) MarshalJSON

func (thisVal NullLocalTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in canonical local time form, or null when empty. The valid path appends directly into a single buffer via time.Time.AppendFormat, skipping the intermediate string and reflection dispatch that json.Marshal(formatLocalTime(...)) would perform.

func (*NullLocalTime) Scan

func (thisVal *NullLocalTime) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface. NULL values produce an invalid NullLocalTime; non-NULL values are delegated to LocalTime.Scan.

func (NullLocalTime) SubOk added in v0.3.0

func (thisVal NullLocalTime) SubOk(other NullLocalTime) (time.Duration, bool)

SubOk returns (thisVal − other, true) when both operands are valid, and (0, false) otherwise.

func (NullLocalTime) ToString

func (thisVal NullLocalTime) ToString() string

ToString renders the value in the library's canonical local time form, or "" when NULL.

func (NullLocalTime) Truncate added in v0.3.0

func (thisVal NullLocalTime) Truncate(d time.Duration) NullLocalTime

Truncate returns thisVal rounded down to the nearest multiple of d since the zero time. NULL propagates.

func (*NullLocalTime) UnmarshalJSON

func (thisVal *NullLocalTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string containing a local time, or the token null. Any other input is treated as a parse error.

func (NullLocalTime) Value

func (thisVal NullLocalTime) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case is materialised via LocalTime.ToTime (a same-day time.Time in UTC).

type NullOffsetDateTime

type NullOffsetDateTime struct {
	Val   OffsetDateTime
	Valid bool
}

NullOffsetDateTime is the nullable counterpart of OffsetDateTime. It shares the same serializer (formatOffsetDateTime / parseOffsetDateTime). Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullOffsetDateTime

func NewNullOffsetDateTime(value OffsetDateTime) NullOffsetDateTime

NewNullOffsetDateTime constructs a valid NullOffsetDateTime wrapping value. Use NullOffsetDateTimeFromTime when starting from a time.Time.

func NewNullOffsetDateTimeEmpty

func NewNullOffsetDateTimeEmpty() NullOffsetDateTime

NewNullOffsetDateTimeEmpty returns an invalid (NULL) NullOffsetDateTime.

func NullOffsetDateTimeFromString

func NullOffsetDateTimeFromString(strValue *string) NullOffsetDateTime

NullOffsetDateTimeFromString parses an offset datetime from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullOffsetDateTime.

func NullOffsetDateTimeFromTime added in v0.3.0

func NullOffsetDateTimeFromTime(value time.Time) NullOffsetDateTime

NullOffsetDateTimeFromTime constructs a valid NullOffsetDateTime from a time.Time. Equivalent to NewNullOffsetDateTime(OffsetDateTime(value)).

func (NullOffsetDateTime) Add added in v0.3.0

Add returns thisVal shifted by d. NULL propagates.

func (NullOffsetDateTime) AddDate added in v0.3.0

func (thisVal NullOffsetDateTime) AddDate(years, months, days int) NullOffsetDateTime

AddDate returns thisVal with the given years/months/days added. NULL propagates.

func (NullOffsetDateTime) After

func (thisVal NullOffsetDateTime) After(other NullOffsetDateTime) bool

After reports whether thisVal is after other under sortable NULL semantics: NULL is never after any value (including another NULL).

func (NullOffsetDateTime) Before

func (thisVal NullOffsetDateTime) Before(other NullOffsetDateTime) bool

Before reports whether thisVal precedes other under sortable NULL semantics: NULL is strictly less than any valid value, two NULLs compare equal (so neither is Before the other).

func (NullOffsetDateTime) Compare added in v0.3.0

func (thisVal NullOffsetDateTime) Compare(other NullOffsetDateTime) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other under sortable NULL semantics: NULL precedes any valid value, two NULLs compare equal.

func (NullOffsetDateTime) Equal added in v0.3.0

func (thisVal NullOffsetDateTime) Equal(other NullOffsetDateTime) bool

Equal reports whether thisVal and other are equal under sortable NULL semantics: two NULLs are equal; NULL is never equal to a valid value.

func (NullOffsetDateTime) In added in v0.3.0

In returns the same instant rendered in loc, mirroring OffsetDateTime.In. NULL propagates: an invalid receiver is returned unchanged.

func (*NullOffsetDateTime) IsEmpty

func (thisVal *NullOffsetDateTime) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullOffsetDateTime) IsZero

func (thisVal NullOffsetDateTime) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullOffsetDateTime) MarshalJSON

func (thisVal NullOffsetDateTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in canonical offset datetime form, or null when empty. The valid path appends directly into a single buffer via time.Time.AppendFormat, skipping the intermediate string and reflection dispatch that json.Marshal(formatOffsetDateTime(...)) would perform.

func (*NullOffsetDateTime) Scan

func (thisVal *NullOffsetDateTime) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullTime so that the driver's NULL signalling is honoured.

func (NullOffsetDateTime) SubOk added in v0.3.0

func (thisVal NullOffsetDateTime) SubOk(other NullOffsetDateTime) (time.Duration, bool)

SubOk returns (thisVal − other, true) when both operands are valid, and (0, false) otherwise.

func (NullOffsetDateTime) ToString

func (thisVal NullOffsetDateTime) ToString() string

ToString renders the value in the library's canonical offset datetime form, or "" when NULL.

func (NullOffsetDateTime) Truncate added in v0.3.0

func (thisVal NullOffsetDateTime) Truncate(d time.Duration) NullOffsetDateTime

Truncate returns thisVal rounded down to the nearest multiple of d since the zero time. NULL propagates.

func (NullOffsetDateTime) UTC added in v0.3.0

func (thisVal NullOffsetDateTime) UTC() NullOffsetDateTime

UTC is shorthand for In(time.UTC). NULL propagates.

func (NullOffsetDateTime) UnixMicroOk added in v0.3.0

func (thisVal NullOffsetDateTime) UnixMicroOk() (int64, bool)

UnixMicroOk returns the microsecond-precision Unix timestamp and ok=true if the receiver is valid; (0, false) for NULL.

func (NullOffsetDateTime) UnixMilliOk added in v0.3.0

func (thisVal NullOffsetDateTime) UnixMilliOk() (int64, bool)

UnixMilliOk returns the millisecond-precision Unix timestamp and ok=true if the receiver is valid; (0, false) for NULL.

func (NullOffsetDateTime) UnixNanoOk added in v0.3.0

func (thisVal NullOffsetDateTime) UnixNanoOk() (int64, bool)

UnixNanoOk returns the nanosecond-precision Unix timestamp and ok=true if the receiver is valid; (0, false) for NULL.

func (NullOffsetDateTime) UnixOk added in v0.3.0

func (thisVal NullOffsetDateTime) UnixOk() (int64, bool)

UnixOk returns the underlying instant as a Unix timestamp (seconds since 1970-01-01 UTC) and ok=true if the receiver is valid. For NULL the result is (0, false) — distinguishing NULL from the Unix epoch, which the legacy Unix() method (removed in v0.3.0) could not.

func (*NullOffsetDateTime) UnmarshalJSON

func (thisVal *NullOffsetDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string containing an offset datetime, or the token null. Any other input is treated as a parse error.

func (NullOffsetDateTime) Value

func (thisVal NullOffsetDateTime) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case is emitted as the underlying time.Time.

type NullOffsetTime

type NullOffsetTime struct {
	Val   OffsetTime
	Valid bool
}

NullOffsetTime is the nullable counterpart of OffsetTime. It shares the same serializer (formatOffsetTime / parseOffsetTime). Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullOffsetTime

func NewNullOffsetTime(value OffsetTime) NullOffsetTime

NewNullOffsetTime constructs a valid NullOffsetTime wrapping value. Use NullOffsetTimeFromTime when starting from a time.Time.

func NewNullOffsetTimeEmpty

func NewNullOffsetTimeEmpty() NullOffsetTime

NewNullOffsetTimeEmpty returns an invalid (NULL) NullOffsetTime.

func NullOffsetTimeFromString

func NullOffsetTimeFromString(strValue *string) NullOffsetTime

NullOffsetTimeFromString parses an offset time from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullOffsetTime.

func NullOffsetTimeFromTime added in v0.3.0

func NullOffsetTimeFromTime(value time.Time) NullOffsetTime

NullOffsetTimeFromTime constructs a valid NullOffsetTime from a time.Time. Equivalent to NewNullOffsetTime(OffsetTime(value)).

func (NullOffsetTime) Add added in v0.3.0

func (thisVal NullOffsetTime) Add(d time.Duration) NullOffsetTime

Add returns thisVal shifted by d. NULL propagates. No modulo-24h enforcement — see OffsetTime.Add.

func (NullOffsetTime) After added in v0.3.0

func (thisVal NullOffsetTime) After(other NullOffsetTime) bool

After reports whether thisVal is after other under sortable NULL semantics: NULL is never after any value (including another NULL).

func (NullOffsetTime) Before added in v0.3.0

func (thisVal NullOffsetTime) Before(other NullOffsetTime) bool

Before reports whether thisVal precedes other under sortable NULL semantics: NULL is strictly less than any valid value, two NULLs compare equal (so neither is Before the other).

func (NullOffsetTime) Compare added in v0.3.0

func (thisVal NullOffsetTime) Compare(other NullOffsetTime) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other under sortable NULL semantics.

func (NullOffsetTime) Equal added in v0.3.0

func (thisVal NullOffsetTime) Equal(other NullOffsetTime) bool

Equal reports whether thisVal and other are equal under sortable NULL semantics: two NULLs are equal; NULL is never equal to a valid value.

func (NullOffsetTime) In added in v0.3.0

func (thisVal NullOffsetTime) In(loc *time.Location) NullOffsetTime

In returns the same instant rendered in loc, mirroring OffsetTime.In. NULL propagates: an invalid receiver is returned unchanged.

func (*NullOffsetTime) IsEmpty

func (thisVal *NullOffsetTime) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullOffsetTime) IsZero

func (thisVal NullOffsetTime) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullOffsetTime) MarshalJSON

func (thisVal NullOffsetTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in canonical offset time form, or null when empty. The valid path appends directly into a single buffer via time.Time.AppendFormat, skipping the intermediate string and reflection dispatch that json.Marshal(formatOffsetTime(...)) would perform.

func (*NullOffsetTime) Scan

func (thisVal *NullOffsetTime) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullTime so that the driver's NULL signalling is honoured.

func (NullOffsetTime) SubOk added in v0.3.0

func (thisVal NullOffsetTime) SubOk(other NullOffsetTime) (time.Duration, bool)

SubOk returns (thisVal − other, true) when both operands are valid, and (0, false) otherwise.

func (NullOffsetTime) ToString

func (thisVal NullOffsetTime) ToString() string

ToString renders the value in the library's canonical offset time form, or "" when NULL.

func (NullOffsetTime) Truncate added in v0.3.0

func (thisVal NullOffsetTime) Truncate(d time.Duration) NullOffsetTime

Truncate returns thisVal rounded down to the nearest multiple of d since the zero time. NULL propagates.

func (NullOffsetTime) UTC added in v0.3.0

func (thisVal NullOffsetTime) UTC() NullOffsetTime

UTC is shorthand for In(time.UTC). NULL propagates.

func (*NullOffsetTime) UnmarshalJSON

func (thisVal *NullOffsetTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string containing an offset time, or the token null. Any other input is treated as a parse error.

func (NullOffsetTime) Value

func (thisVal NullOffsetTime) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case is emitted as the underlying time.Time.

type NullString

type NullString struct {
	Val   string
	Valid bool
}

NullString is a nullable string. Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullString

func NewNullString(value string) NullString

NewNullString constructs a valid NullString wrapping value. The empty string is preserved as a valid value; use NewNullStringEmpty or NSFromString if an empty input should collapse to NULL.

func NewNullStringEmpty

func NewNullStringEmpty() NullString

NewNullStringEmpty returns an invalid (NULL) NullString.

func (*NullString) IsEmpty

func (thisVal *NullString) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullString) IsZero

func (thisVal NullString) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullString) MarshalJSON

func (thisVal NullString) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string, or null when empty.

func (*NullString) Scan

func (thisVal *NullString) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface, delegating to sql.NullString so that the driver's NULL signalling is honoured.

func (NullString) ToString

func (thisVal NullString) ToString() string

ToString returns the underlying string, or "" when NULL. Note that valid empty strings are indistinguishable from NULL in this output — use the Valid field directly to discriminate.

func (*NullString) UnmarshalJSON

func (thisVal *NullString) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string or the token null. Surrounding quotes and JSON escape sequences are decoded via encoding/json.

func (NullString) Value

func (thisVal NullString) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil).

type NullUUID added in v0.2.0

type NullUUID struct {
	Val   uuid.UUID
	Valid bool
}

NullUUID is a nullable UUID backed by github.com/google/uuid. Valid reports whether Val holds a meaningful value (true) or a SQL/JSON NULL (false).

func NewNullUUID added in v0.2.0

func NewNullUUID(val uuid.UUID) NullUUID

NewNullUUID constructs a valid NullUUID wrapping val.

func NewNullUUIDEmpty added in v0.2.0

func NewNullUUIDEmpty() NullUUID

NewNullUUIDEmpty returns an invalid (NULL) NullUUID.

func NullUUIDFromString added in v0.2.0

func NullUUIDFromString(strValue *string) NullUUID

NullUUIDFromString parses a UUID from the string pointer. A nil pointer, an empty string, the tokens "null"/"nil" (case-insensitive), or a parse error all produce an invalid NullUUID.

func (*NullUUID) IsEmpty added in v0.2.0

func (thisVal *NullUUID) IsEmpty() bool

IsEmpty reports whether the value is NULL (Valid == false).

func (NullUUID) IsZero added in v0.2.0

func (thisVal NullUUID) IsZero() bool

IsZero reports whether the value is NULL (Valid == false). Mirroring time.Time.IsZero, this also enables encoding/json's `omitzero` tag (Go 1.24+) to elide invalid wrappers from marshalled output.

func (NullUUID) MarshalJSON added in v0.2.0

func (thisVal NullUUID) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in canonical UUID form, or null when empty.

func (*NullUUID) Scan added in v0.2.0

func (thisVal *NullUUID) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface. The UUID is received as text from the driver (via sql.NullString) and parsed through NullUUIDFromString.

func (NullUUID) ToString added in v0.2.0

func (thisVal NullUUID) ToString() string

ToString renders the UUID in canonical 8-4-4-4-12 hex form, or "" when NULL.

func (*NullUUID) UnmarshalJSON added in v0.2.0

func (thisVal *NullUUID) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string containing a UUID, or the token null. Any other input is treated as a parse error.

func (NullUUID) Value added in v0.2.0

func (thisVal NullUUID) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface. A NULL value is emitted as (nil, nil); the valid case delegates to uuid.UUID.Value, which renders the UUID as its canonical 8-4-4-4-12 hex string.

type OffsetDateTime

type OffsetDateTime time.Time

OffsetDateTime is a not-null datetime with a timezone offset (RFC 3339).

Use OffsetDateTime when the value is anchored to a specific point in time (e.g. an event timestamp). For wall-clock datetimes without an offset, use LocalDateTime.

func NewOffsetDateTime

func NewOffsetDateTime(t time.Time) OffsetDateTime

NewOffsetDateTime wraps t as an OffsetDateTime, preserving its location.

func OffsetDateTimeFromString

func OffsetDateTimeFromString(strValue string) (OffsetDateTime, error)

OffsetDateTimeFromString parses a datetime in any of the formats accepted by ParseDateTimeFromString.

func (OffsetDateTime) Add added in v0.3.0

func (thisVal OffsetDateTime) Add(d time.Duration) OffsetDateTime

Add returns thisVal shifted by d.

func (OffsetDateTime) AddDate added in v0.3.0

func (thisVal OffsetDateTime) AddDate(years, months, days int) OffsetDateTime

AddDate returns thisVal with the given years/months/days added.

func (OffsetDateTime) After

func (thisVal OffsetDateTime) After(other OffsetDateTime) bool

After reports whether thisVal is after other.

func (OffsetDateTime) AsTime

func (thisVal OffsetDateTime) AsTime() time.Time

AsTime returns the underlying time.Time.

func (OffsetDateTime) Before

func (thisVal OffsetDateTime) Before(other OffsetDateTime) bool

Before reports whether thisVal precedes other.

func (OffsetDateTime) Compare added in v0.3.0

func (thisVal OffsetDateTime) Compare(other OffsetDateTime) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other.

func (OffsetDateTime) Day added in v0.3.0

func (thisVal OffsetDateTime) Day() int

Day returns the day of the month (1-31).

func (OffsetDateTime) Equal added in v0.3.0

func (thisVal OffsetDateTime) Equal(other OffsetDateTime) bool

Equal reports whether thisVal and other denote the same instant. Two values that differ only in zone (e.g. "10:00:00+04:00" and "06:00:00Z") are Equal.

func (OffsetDateTime) Hour added in v0.3.0

func (thisVal OffsetDateTime) Hour() int

Hour returns the hour of the day (0-23).

func (OffsetDateTime) In added in v0.3.0

func (thisVal OffsetDateTime) In(loc *time.Location) OffsetDateTime

In returns the same instant rendered in loc. Mirrors time.Time.In: the absolute moment is preserved, only the displayed offset / wall clock changes (e.g. "10:00:00+04:00" becomes "06:00:00Z" when converted to UTC).

func (OffsetDateTime) MarshalJSON

func (thisVal OffsetDateTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in the library's canonical TZ-aware format.

func (OffsetDateTime) Minute added in v0.3.0

func (thisVal OffsetDateTime) Minute() int

Minute returns the minute of the hour (0-59).

func (OffsetDateTime) Month added in v0.3.0

func (thisVal OffsetDateTime) Month() time.Month

Month returns the calendar month.

func (OffsetDateTime) Nanosecond added in v0.3.0

func (thisVal OffsetDateTime) Nanosecond() int

Nanosecond returns the nanosecond offset within the second (0-999999999).

func (*OffsetDateTime) Scan

func (thisVal *OffsetDateTime) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface. A NULL value is rejected — OffsetDateTime cannot be empty.

func (OffsetDateTime) Second added in v0.3.0

func (thisVal OffsetDateTime) Second() int

Second returns the second of the minute (0-59).

func (OffsetDateTime) Sub added in v0.3.0

func (thisVal OffsetDateTime) Sub(other OffsetDateTime) time.Duration

Sub returns thisVal − other as a time.Duration.

func (OffsetDateTime) ToString

func (thisVal OffsetDateTime) ToString() string

ToString renders the value in the library's canonical TZ-aware format.

func (OffsetDateTime) Truncate added in v0.3.0

func (thisVal OffsetDateTime) Truncate(d time.Duration) OffsetDateTime

Truncate returns thisVal rounded down to the nearest multiple of d since the zero time. Mirrors time.Time.Truncate.

func (OffsetDateTime) UTC added in v0.3.0

func (thisVal OffsetDateTime) UTC() OffsetDateTime

UTC is shorthand for In(time.UTC).

func (OffsetDateTime) Unix

func (thisVal OffsetDateTime) Unix() int64

Unix returns the underlying instant as a Unix timestamp — the number of seconds elapsed since January 1, 1970 UTC.

func (OffsetDateTime) UnixMicro added in v0.3.0

func (thisVal OffsetDateTime) UnixMicro() int64

UnixMicro returns the underlying instant as microseconds since 1970-01-01 UTC.

func (OffsetDateTime) UnixMilli added in v0.3.0

func (thisVal OffsetDateTime) UnixMilli() int64

UnixMilli returns the underlying instant as milliseconds since 1970-01-01 UTC.

func (OffsetDateTime) UnixNano added in v0.3.0

func (thisVal OffsetDateTime) UnixNano() int64

UnixNano returns the underlying instant as nanoseconds since 1970-01-01 UTC.

func (*OffsetDateTime) UnmarshalJSON

func (thisVal *OffsetDateTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string in any of the formats accepted by OffsetDateTimeFromString. JSON null is rejected — OffsetDateTime cannot be empty.

func (OffsetDateTime) Value

func (thisVal OffsetDateTime) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

func (OffsetDateTime) Year added in v0.3.0

func (thisVal OffsetDateTime) Year() int

Year returns the calendar year (in the value's zone).

func (OffsetDateTime) YearDay added in v0.3.0

func (thisVal OffsetDateTime) YearDay() int

YearDay returns the day-of-year (1-365 / 1-366 in leap years).

type OffsetTime

type OffsetTime time.Time

OffsetTime is a not-null time-of-day with a timezone offset.

Use OffsetTime when the time-of-day value carries a meaningful zone offset (e.g. exchange opens at "09:30:00-05:00"). For zone-less times, use LocalTime.

func NewOffsetTime

func NewOffsetTime(t time.Time) OffsetTime

NewOffsetTime wraps t as an OffsetTime, preserving its location.

func OffsetTimeFromString

func OffsetTimeFromString(strValue string) (OffsetTime, error)

OffsetTimeFromString parses a time-of-day with an optional timezone designator. When no designator is present, time.Local is assumed.

func (OffsetTime) Add added in v0.3.0

func (thisVal OffsetTime) Add(d time.Duration) OffsetTime

Add returns thisVal shifted by d. No modulo-24h enforcement: a duration that crosses midnight rotates the implicit date in the underlying time.Time, but the date is not part of OffsetTime's serialised form. Consume with care.

func (OffsetTime) After added in v0.3.0

func (thisVal OffsetTime) After(other OffsetTime) bool

After reports whether thisVal is after other.

func (OffsetTime) AsTime

func (thisVal OffsetTime) AsTime() time.Time

AsTime returns the underlying time.Time.

func (OffsetTime) Before added in v0.3.0

func (thisVal OffsetTime) Before(other OffsetTime) bool

Before reports whether thisVal precedes other.

func (OffsetTime) Compare added in v0.3.0

func (thisVal OffsetTime) Compare(other OffsetTime) int

Compare returns -1, 0, or +1 as thisVal is before, equal to, or after other.

func (OffsetTime) Equal added in v0.3.0

func (thisVal OffsetTime) Equal(other OffsetTime) bool

Equal reports whether thisVal and other denote the same instant. Two values that differ only in zone (e.g. "10:00:00+04:00" and "06:00:00Z") are Equal.

func (OffsetTime) Hour added in v0.3.0

func (thisVal OffsetTime) Hour() int

Hour returns the hour of the day (0-23).

func (OffsetTime) In added in v0.3.0

func (thisVal OffsetTime) In(loc *time.Location) OffsetTime

In returns the same instant rendered in loc. Mirrors time.Time.In: only the wall-clock representation changes. The implicit date hidden in the underlying time.Time may shift by ±1 day across the zone boundary, but the date is not part of the OffsetTime serialised form.

func (OffsetTime) MarshalJSON

func (thisVal OffsetTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the value as a JSON string in the library's canonical TZ-aware format.

func (OffsetTime) Minute added in v0.3.0

func (thisVal OffsetTime) Minute() int

Minute returns the minute of the hour (0-59).

func (OffsetTime) Nanosecond added in v0.3.0

func (thisVal OffsetTime) Nanosecond() int

Nanosecond returns the nanosecond offset within the second (0-999999999).

func (*OffsetTime) Scan

func (thisVal *OffsetTime) Scan(value interface{}) error

Scan implements the database/sql.Scanner interface. A NULL value is rejected — OffsetTime cannot be empty.

func (OffsetTime) Second added in v0.3.0

func (thisVal OffsetTime) Second() int

Second returns the second of the minute (0-59).

func (OffsetTime) String

func (thisVal OffsetTime) String() string

String renders the value in the library's canonical TZ-aware format.

func (OffsetTime) Sub added in v0.3.0

func (thisVal OffsetTime) Sub(other OffsetTime) time.Duration

Sub returns thisVal − other as a time.Duration. The implicit dates participate in the calculation (so a same-day pair yields a sub-24h difference), but Durations larger than 24h are possible if the operands were constructed at different days.

func (OffsetTime) ToString

func (thisVal OffsetTime) ToString() string

ToString is an alias for String, satisfying the ToStringAble interface.

func (OffsetTime) Truncate added in v0.3.0

func (thisVal OffsetTime) Truncate(d time.Duration) OffsetTime

Truncate returns thisVal rounded down to the nearest multiple of d since the zero time.

func (OffsetTime) UTC added in v0.3.0

func (thisVal OffsetTime) UTC() OffsetTime

UTC is shorthand for In(time.UTC).

func (*OffsetTime) UnmarshalJSON

func (thisVal *OffsetTime) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a JSON string in any of the formats accepted by OffsetTimeFromString. JSON null is rejected — OffsetTime cannot be empty.

func (OffsetTime) Value

func (thisVal OffsetTime) Value() (driver.Value, error)

Value implements the database/sql/driver.Valuer interface.

type ToStringAble

type ToStringAble interface {
	ToString() string
}

ToStringAble is the interface implemented by every nullable type in the package. ToString renders the value in its canonical textual form (an empty string when the value is missing/NULL).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL