model

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameMytable = "mytables"

Variables

This section is empty.

Functions

This section is empty.

Types

type Customer

type Customer struct {
	gorm.Model

	Name    string  `gorm:"type:varchar(100);not null"`
	Age     int     `gorm:"type:int"`
	Phone   string  `gorm:"type:varchar(11)"`
	Address string  `gorm:"type:text"`
	Amount  float64 `gorm:"type:float"`
}

Customer a struct mapping to table customers

func (Customer) TableName

func (Customer) TableName() string

type Mytable

type Mytable struct {
	ID       int32   `gorm:"column:ID;type:int(11);not null" json:"ID_example"`
	Username *string `gorm:"column:username;type:varchar(16);index:idx_username,priority:1;default:NULL" json:"username_example"`
	Age      int32   `gorm:"column:age;type:int(8);not null" json:"age_example"`
	Phone    string  `gorm:"column:phone;type:varchar(11);not null" json:"phone_example"`
}

Mytable mapped from table <mytables>

func (*Mytable) TableName

func (*Mytable) TableName() string

TableName Mytable's table name

Jump to

Keyboard shortcuts

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