datatype

package
v0.0.0-...-08b9edc Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Int

type Int int

Int is an alternative type to the standard int type. Int can be mapped to all numeric SQL field types, including floats. NULL value will be scanned as 0. To distinguish zero and null, use nullable.Int instead.

func (Int) GormDataType

func (n Int) GormDataType() string

GormDataType implements schema.GormDataTypeInterface

func (Int) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (*Int) Scan

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

Scan implements sql.Scanner.

func (*Int) UnmarshalJSON

func (n *Int) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (Int) Value

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

Value implements driver.Valuer.

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp is serialized as microsecond-precision unix timestamps in JSON, and can be mapped to the "timestamp" field type in MySQL / TiDB. NULL value will be scanned as unix timestamp 0. To distinguish zero timestamp and null timestamp, use nullable.Timestamp instead.

This struct is only used for compatibility with existing "timestamp" field types. Int should be always preferred to store timestamps wherever possible.

func (Timestamp) GormDataType

func (n Timestamp) GormDataType() string

GormDataType implements schema.GormDataTypeInterface

func (Timestamp) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (*Timestamp) Scan

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

Scan implements sql.Scanner.

func (*Timestamp) UnmarshalJSON

func (n *Timestamp) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (Timestamp) Value

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

Value implements driver.Valuer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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