utils

package
v0.0.0-...-c678f9e Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FooNotEmptyDefVal = "not empty"

Variables

This section is empty.

Functions

func AssertEqualSQL

func AssertEqualSQL(t *testing.T, db *gorm.DB, expected, actually string)

AssertEqualSQL for assert that the sql is equal, this method will ignore quote, and dialect specials.

Types

type Account

type Account struct {
	gorm.Model
	UserID sql.NullInt64
	Number string
}

type Foo

type Foo struct {
	gorm.Model
	NotEmpty               string
	RestIfLonggerThan1Char string
}

func (*Foo) BeforeUpdate

func (f *Foo) BeforeUpdate(_ *gorm.DB) (err error)

type User

type User struct {
	gorm.Model
	Name      string
	Age       uint `gorm:"default:18"`
	Birthday  *time.Time
	Account   *Account
	Active    bool
	NotUpdate string `gorm:"<-:create"`
}

Jump to

Keyboard shortcuts

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