orm

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntSlice

type IntSlice []int

func (*IntSlice) Scan

func (is *IntSlice) Scan(value any) error

func (IntSlice) Value

func (is IntSlice) Value() (driver.Value, error)

type Option

type Option func(op *gorm.DB)

func PK

func PK(pk interface{}) Option

func Status

func Status(status int) Option

func StatusIn

func StatusIn(status []int) Option

func Table

func Table(name string) Option

type StringSlice

type StringSlice []string

---------------- 逗号分割数据 -------------------------

func (*StringSlice) Scan

func (ss *StringSlice) Scan(value any) error

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

type Uorm

type Uorm struct {
	// contains filtered or unexported fields
}

func NewUorm

func NewUorm(db *gorm.DB) *Uorm

func (*Uorm) Create

func (u *Uorm) Create(i interface{}) error

func (*Uorm) Delete

func (u *Uorm) Delete(i interface{}, ops ...Option) error

func (*Uorm) Fisrt

func (u *Uorm) Fisrt(i interface{}, ops ...Option)

func (*Uorm) Get

func (u *Uorm) Get(i interface{}, ops ...Option)

func (*Uorm) GetDb

func (u *Uorm) GetDb() *gorm.DB

func (*Uorm) Model

func (u *Uorm) Model(i interface{})

func (*Uorm) Save

func (u *Uorm) Save(i interface{}) error

func (*Uorm) SetDb

func (u *Uorm) SetDb(db *gorm.DB)

func (*Uorm) Update

func (u *Uorm) Update(i interface{}, ops ...Option) error

Jump to

Keyboard shortcuts

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