db

package
v0.0.0-...-4c8c39f Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() *gorm.DB

func DBInstance

func DBInstance(c *gin.Context) *gorm.DB

Types

type Parameter

type Parameter struct {
	Filters  map[string]string
	Preloads string
	Sort     string
	Limit    int
	Page     int
	LastID   int
	Order    string
	IsLastID bool
}

func NewParameter

func NewParameter(c *gin.Context, model interface{}) (*Parameter, error)

func (*Parameter) FilterFields

func (self *Parameter) FilterFields(db *gorm.DB) *gorm.DB

func (*Parameter) GetRawFilterQuery

func (self *Parameter) GetRawFilterQuery() string

func (*Parameter) Paginate

func (self *Parameter) Paginate(db *gorm.DB) (*gorm.DB, error)
func (self *Parameter) SetHeaderLink(c *gin.Context, index int) error

func (*Parameter) SetPreloads

func (self *Parameter) SetPreloads(db *gorm.DB) *gorm.DB

func (*Parameter) SortRecords

func (self *Parameter) SortRecords(db *gorm.DB) *gorm.DB

Jump to

Keyboard shortcuts

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