database

package
v0.0.0-...-9ad592c Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryUUID

type BinaryUUID uuid.UUID

binary uuid wrapper over uuid.UUID example - gorm:"type:binary(16);default:(UUID_TO_BIN(UUID()));

func (BinaryUUID) GormDataType

func (a BinaryUUID) GormDataType() string

sql data type for gorm

func (BinaryUUID) MarshalJSON

func (a BinaryUUID) MarshalJSON() ([]byte, error)

convert to json string

func (*BinaryUUID) Scan

func (a *BinaryUUID) Scan(value interface{}) error

scan value into BinaryUUID

func (BinaryUUID) String

func (a BinaryUUID) String() string

func (*BinaryUUID) UnmarshalJSON

func (a *BinaryUUID) UnmarshalJSON(by []byte) error

convert from json string

func (BinaryUUID) Value

func (a BinaryUUID) Value() (driver.Value, error)

return BinaryUUID to []bytes binary(16)

type Datetime

type Datetime sql.NullTime

custom time types Used to format time into a human-readable string

func (Datetime) MarshalJSON

func (a Datetime) MarshalJSON() ([]byte, error)

func (*Datetime) Scan

func (a *Datetime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*Datetime) UnmarshalJSON

func (a *Datetime) UnmarshalJSON(b []byte) error

func (Datetime) Value

func (a Datetime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Model

type Model struct {
	RecordID  uint           `gorm:"column:record_id;primaryKey;autoIncrement;" json:"-"`
	CreatedAt Datetime       `gorm:"column:created_at;autoCreateTime;" json:"created_at"`
	UpdatedAt Datetime       `gorm:"column:updated_at;autoUpdateTime;" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index;" json:"-"`
}

Model base model

Jump to

Keyboard shortcuts

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