nullables

package
v0.0.0-...-bea3eb9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NullBool

type NullBool struct {
	// contains filtered or unexported fields
}

NullBool has non-exported sql.NullBool, requires use of exported receiver functions to access

func NewNullBool

func NewNullBool(value bool) *NullBool

func (*NullBool) GetBool

func (r *NullBool) GetBool() *bool

func (*NullBool) GetFloat64

func (r *NullBool) GetFloat64() *float64

func (*NullBool) GetInt64

func (r *NullBool) GetInt64() *int64

func (*NullBool) GetString

func (r *NullBool) GetString() *string

func (*NullBool) GetTime

func (r *NullBool) GetTime() *time.Time

func (*NullBool) GetType

func (r *NullBool) GetType() NullableType

func (*NullBool) GetValue

func (r *NullBool) GetValue() *bool

func (*NullBool) IsNil

func (r *NullBool) IsNil() bool

func (*NullBool) MarshalJSON

func (r *NullBool) MarshalJSON() ([]byte, error)

func (*NullBool) Scan

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

func (*NullBool) SetValue

func (r *NullBool) SetValue(value *bool)

func (*NullBool) UnmarshalJSON

func (r *NullBool) UnmarshalJSON(b []byte) error

type NullBoolIfc

type NullBoolIfc interface {
	GetValue() *bool
	SetValue(value *bool)
}

type NullFloat64

type NullFloat64 struct {
	// contains filtered or unexported fields
}

func NewNullFloat64

func NewNullFloat64(value float64) *NullFloat64

func (*NullFloat64) GetBool

func (r *NullFloat64) GetBool() *bool

func (*NullFloat64) GetFloat64

func (r *NullFloat64) GetFloat64() *float64

func (*NullFloat64) GetInt64

func (r *NullFloat64) GetInt64() *int64

func (*NullFloat64) GetString

func (r *NullFloat64) GetString() *string

func (*NullFloat64) GetTime

func (r *NullFloat64) GetTime() *time.Time

func (*NullFloat64) GetType

func (r *NullFloat64) GetType() NullableType

func (*NullFloat64) GetValue

func (r *NullFloat64) GetValue() *float64

func (*NullFloat64) IsNil

func (r *NullFloat64) IsNil() bool

func (*NullFloat64) MarshalJSON

func (r *NullFloat64) MarshalJSON() ([]byte, error)

func (*NullFloat64) Scan

func (r *NullFloat64) Scan(value interface{}) error

func (*NullFloat64) SetValue

func (r *NullFloat64) SetValue(value *float64)

func (*NullFloat64) UnmarshalJSON

func (r *NullFloat64) UnmarshalJSON(b []byte) error

type NullFloat64Ifc

type NullFloat64Ifc interface {
	GetValue() *float64
	SetValue(value *float64)
}

NullFloat has non-exported sql.NullFloat, requires use of exported receiver functions to access

type NullInt64

type NullInt64 struct {
	// contains filtered or unexported fields
}

func NewNullInt64

func NewNullInt64(value int64) *NullInt64

func (*NullInt64) GetBool

func (r *NullInt64) GetBool() *bool

func (*NullInt64) GetFloat64

func (r *NullInt64) GetFloat64() *float64

func (*NullInt64) GetInt64

func (r *NullInt64) GetInt64() *int64

func (*NullInt64) GetString

func (r *NullInt64) GetString() *string

func (*NullInt64) GetTime

func (r *NullInt64) GetTime() *time.Time

func (*NullInt64) GetType

func (r *NullInt64) GetType() NullableType

func (*NullInt64) GetValue

func (r *NullInt64) GetValue() *int64

func (*NullInt64) IsNil

func (r *NullInt64) IsNil() bool

func (*NullInt64) MarshalJSON

func (r *NullInt64) MarshalJSON() ([]byte, error)

func (*NullInt64) Scan

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

func (*NullInt64) SetValue

func (r *NullInt64) SetValue(value *int64)

func (*NullInt64) UnmarshalJSON

func (r *NullInt64) UnmarshalJSON(b []byte) error

type NullInt64Ifc

type NullInt64Ifc interface {
	GetValue() *int64
	SetValue(value *int64)
}

NullInt64 has non-exported sql.NullInt64, requires use of exported receiver functions to access

type NullString

type NullString struct {
	// contains filtered or unexported fields
}

NullString has non-exported sql.NullString, requires use of exported receiver functions to access

func NewNullString

func NewNullString(value string) *NullString

func (*NullString) GetBool

func (r *NullString) GetBool() *bool

func (*NullString) GetFloat64

func (r *NullString) GetFloat64() *float64

func (*NullString) GetInt64

func (r *NullString) GetInt64() *int64

func (*NullString) GetString

func (r *NullString) GetString() *string

func (*NullString) GetTime

func (r *NullString) GetTime() *time.Time

func (*NullString) GetType

func (r *NullString) GetType() NullableType

func (*NullString) GetValue

func (r *NullString) GetValue() *string

func (*NullString) IsNil

func (r *NullString) IsNil() bool

func (*NullString) MarshalJSON

func (r *NullString) MarshalJSON() ([]byte, error)

func (*NullString) Scan

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

func (*NullString) SetValue

func (r *NullString) SetValue(value *string)

func (*NullString) UnmarshalJSON

func (r *NullString) UnmarshalJSON(b []byte) error

type NullStringIfc

type NullStringIfc interface {
	GetValue() *string
	SetValue(value *string)
}

type NullTime

type NullTime struct {
	// contains filtered or unexported fields
}

NullTime is an alias for sql.NullTime data type which we extend

func NewNullTime

func NewNullTime(v time.Time) *NullTime

func (*NullTime) GetBool

func (r *NullTime) GetBool() *bool

func (*NullTime) GetFloat64

func (r *NullTime) GetFloat64() *float64

func (*NullTime) GetInt64

func (r *NullTime) GetInt64() *int64

func (*NullTime) GetString

func (r *NullTime) GetString() *string

func (*NullTime) GetTime

func (r *NullTime) GetTime() *time.Time

func (*NullTime) GetType

func (r *NullTime) GetType() NullableType

func (*NullTime) GetValue

func (r *NullTime) GetValue() *time.Time

func (*NullTime) IsNil

func (r *NullTime) IsNil() bool

func (*NullTime) MarshalJSON

func (r *NullTime) MarshalJSON() ([]byte, error)

func (*NullTime) Scan

func (r *NullTime) Scan(value interface{}) error

func (*NullTime) SetValue

func (r *NullTime) SetValue(v *time.Time)

func (*NullTime) UnmarshalJSON

func (r *NullTime) UnmarshalJSON(b []byte) error

type NullTimeIfc

type NullTimeIfc interface {
	GetValue() *time.Time
	SetValue(value *time.Time)
}

NullTime has non-exported sql.NullTime, requires use of exported receiver functions to access

type Nullable

type Nullable struct {
	// contains filtered or unexported fields
}

func NewNullable

func NewNullable(value interface{}) *Nullable

func (*Nullable) GetBool

func (r *Nullable) GetBool() *bool

func (*Nullable) GetBoolDefault

func (r *Nullable) GetBoolDefault(d bool) bool

func (*Nullable) GetFloat64

func (r *Nullable) GetFloat64() *float64

func (*Nullable) GetFloat64Default

func (r *Nullable) GetFloat64Default(d float64) float64

func (*Nullable) GetInt64

func (r *Nullable) GetInt64() *int64

func (*Nullable) GetInt64Default

func (r *Nullable) GetInt64Default(d int64) int64

func (*Nullable) GetString

func (r *Nullable) GetString() *string

func (*Nullable) GetStringDefault

func (r *Nullable) GetStringDefault(d string) string

func (*Nullable) GetTime

func (r *Nullable) GetTime() *time.Time

func (*Nullable) GetTimeDefault

func (r *Nullable) GetTimeDefault(d time.Time) time.Time

func (*Nullable) GetType

func (r *Nullable) GetType() NullableType

func (*Nullable) IsNil

func (r *Nullable) IsNil() bool

func (*Nullable) MarshalJSON

func (r *Nullable) MarshalJSON() ([]byte, error)

func (*Nullable) Scan

func (r *Nullable) Scan(value interface{}) error

Scan for Nullable - we just sub it out to the underlying Nullable type

func (*Nullable) SetValue

func (r *Nullable) SetValue(v interface{}) error

Convert value to appropriate Nullable; return true on success, else false

func (*Nullable) UnmarshalJSON

func (r *Nullable) UnmarshalJSON(b []byte) error

type NullableIfc

type NullableIfc interface {
	NullableValueIfc
	GetInt64Default(d int64) int64
	GetBoolDefault(d bool) bool
	GetFloat64Default(d float64) float64
	GetStringDefault(d string) string
	GetTimeDefault(d time.Time) time.Time
}

type NullableType

type NullableType int8
const (
	NULLABLE_NIL NullableType = iota
	NULLABLE_INT64
	NULLABLE_BOOL
	NULLABLE_FLOAT64
	NULLABLE_STRING
	NULLABLE_TIME
)

type NullableValueIfc

type NullableValueIfc interface {
	GetType() NullableType
	GetInt64() *int64
	GetBool() *bool
	GetFloat64() *float64
	GetString() *string
	GetTime() *time.Time
	IsNil() bool
	Scan(value interface{}) error
	MarshalJSON() ([]byte, error)
	UnmarshalJSON(b []byte) error
}

Jump to

Keyboard shortcuts

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