gorm_expand

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

gorm-expand

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Columns

func Columns(v any) []string

func ColumnsNotNil

func ColumnsNotNil(v any) ([]string, int, []any)

func TableName

func TableName(v any) string

Types

type Mapper

type Mapper[T any] struct {
	// contains filtered or unexported fields
}

func (Mapper[T]) DeleteById

func (m Mapper[T]) DeleteById(id any) error

func (Mapper[T]) Get

func (m Mapper[T]) Get(t T) (T, error)

func (Mapper[T]) GetById

func (m Mapper[T]) GetById(id any) (T, error)

func (Mapper[T]) GetDb

func (m Mapper[T]) GetDb() *gorm.DB

func (Mapper[T]) Insert

func (m Mapper[T]) Insert(t T) error

func (Mapper[T]) List

func (m Mapper[T]) List() ([]T, error)

func (Mapper[T]) ListByCondition

func (m Mapper[T]) ListByCondition(t T) ([]T, error)

func (Mapper[T]) Page

func (m Mapper[T]) Page(page Page) ([]T, int64, error)

func (Mapper[T]) PageByCondition

func (m Mapper[T]) PageByCondition(t T, page Page) ([]T, int64, error)

func (*Mapper[T]) SetDb

func (m *Mapper[T]) SetDb(db *gorm.DB)

func (Mapper[T]) UpdateById

func (m Mapper[T]) UpdateById(t T) error

type Page

type Page struct {
	Current  int
	PageSize int
}

Jump to

Keyboard shortcuts

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