sqltypes

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: MIT Imports: 12 Imported by: 0

README

sqltypes

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecimalFromString

func DecimalFromString(s string) decimal.Decimal

Types

type NullBool

type NullBool bool

NullBool is a bool that can be NULL (from DB)

func Bool

func Bool(v bool) NullBool

Bool returns NullBool

func (*NullBool) Scan

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

Scan implements the Scanner interface.

func (NullBool) Value

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

Value implements the driver Valuer interface.

type NullDate

type NullDate string

func (NullDate) Day

func (d NullDate) Day() int

Day returns the day

func (NullDate) IsZero

func (d NullDate) IsZero() bool

func (*NullDate) MarshalJSON

func (d *NullDate) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (NullDate) Month

func (d NullDate) Month() time.Month

Month returns the month

func (*NullDate) Scan

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

func (NullDate) T

func (d NullDate) T() time.Time

func (*NullDate) UnmarshalJSON

func (d *NullDate) UnmarshalJSON(v []byte) error

UnmarshalJSON implements json.Unmarshaler

func (NullDate) Value

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

Value database/sql/

func (NullDate) YMD added in v1.0.1

func (d NullDate) YMD() (year, month, day int)

func (NullDate) Year

func (d NullDate) Year() int

Year returns the year

type NullDecimal

type NullDecimal decimal.Decimal

func Decimal

func Decimal(v decimal.Decimal) NullDecimal

Decimal returns a NullDecimal

func (NullDecimal) D

func (d NullDecimal) D() decimal.Decimal

func (NullDecimal) MarshalJSON

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

MarshalJSON implements json.Marshaler

func (*NullDecimal) Scan

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

func (*NullDecimal) UnmarshalJSON

func (n *NullDecimal) UnmarshalJSON(v []byte) error

UnmarshalJSON implements json.Unmarshaler

func (NullDecimal) Value

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

type NullFloat64

type NullFloat64 float64

NullFloat64 is a float64 with the 0 value being nil (on sending to sql)

func (*NullFloat64) Scan

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

Scan implements the Scanner interface.

func (NullFloat64) Value

func (n NullFloat64) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullInt0

type NullInt0 int

NullInt0 is a normal int (0 = nil)

func Int0

func Int0(v int) NullInt0

Int0 returns NullInt0

func (*NullInt0) Scan

func (n *NullInt0) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullInt0) Value

func (n NullInt0) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullIntM1

type NullIntM1 int

NullIntM1 is a normal int (-1 = nil)

func IntM1

func IntM1(v int) NullIntM1

IntM1 returns NullIntM1

func (NullIntM1) IsNull

func (n NullIntM1) IsNull() bool

IsNull = (v == -1)

func (*NullIntM1) Scan

func (n *NullIntM1) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullIntM1) Value

func (n NullIntM1) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullString

type NullString string

func String

func String(v string) NullString

String returns NullString

func (*NullString) Scan

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

Scan implements the Scanner interface.

func (NullString) String

func (n NullString) String() string

func (*NullString) UnmarshalJSON

func (n *NullString) UnmarshalJSON(v []byte) error

UnmarshalJSON implements json.Unmarshaler

func (NullString) Value

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

Value implements the driver Valuer interface.

type NullTime

type NullTime time.Time

func (NullTime) MarshalJSON

func (n NullTime) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*NullTime) Scan

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

func (NullTime) T

func (t NullTime) T() time.Time

func (*NullTime) UnmarshalJSON

func (n *NullTime) UnmarshalJSON(v []byte) error

implements json.Unmarshaler

func (NullTime) Value

func (t NullTime) Value() (driver.Value, error)

type NullUint64

type NullUint64 uint64

func (*NullUint64) Scan

func (n *NullUint64) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUint64) Value

func (n NullUint64) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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