gorms

package
v0.0.0-...-3f4f73c Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	ID        string         `gorm:"primaryKey;default:(gen_ulid())" sql:"DEFAULT:gen_ulid()"` // sqlite must define as (gen_ulid())
	CreatedAt time.Time      `gorm:"index" sql:"type:timestamptz; DEFAULT:current_timestamp"`
	UpdatedAt time.Time      `gorm:"index" sql:"type:timestamptz; DEFAULT:current_timestamp"`
	DeletedAt gorm.DeletedAt `gorm:"index"`
	DB        *gorm.DB       `gorm:"-" mapstructure:"-" json:"-" yaml:"-" copier:"-"`
}

func (*Model) AfterFind

func (model *Model) AfterFind(tx *gorm.DB) (err error)

func (*Model) BeforeSave

func (model *Model) BeforeSave(tx *gorm.DB) (err error)

func (*Model) GetDB

func (model *Model) GetDB() *gorm.DB

Jump to

Keyboard shortcuts

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