pkg

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

func Query[T interface{}](db *gorm.DB, object *[]T, strSelect string, where []map[string]string, orders []string, page Page)

func QueryAll

func QueryAll[T interface{}](db *gorm.DB, object *[]T, strSelect string, where []map[string]string, strOrder []string)

func Raw

func Raw[T interface{}](db *gorm.DB, objects *[]T, raw string, variables ...interface{})

func SaveBatch

func SaveBatch[T interface{}](db *gorm.DB, objs []T, vars ...string) *gorm.DB

func SelectAllByField

func SelectAllByField[T interface{}](db *gorm.DB, objects *[]T, orderId string, field string) error

func SelectById

func SelectById[T interface{}](db *gorm.DB, orderId string, object *T) error

func UpdatesWhere

func UpdatesWhere[T comparable](db *gorm.DB, o T, where map[string]string, vars ...[]string) *gorm.DB

Types

type DBEx

type DBEx struct{ DB *gorm.DB }

type Page

type Page struct {
	PageNum  int64
	PageSize int64
}

func (Page) GetSqlText

func (p Page) GetSqlText() string

Jump to

Keyboard shortcuts

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