gorm

package
v0.0.0-...-31a0336 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: MIT Imports: 2 Imported by: 0

README

common/gorm

query

整合多条件查询数据库,并携带上下文分页排序计数等信息。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Query string
	Args  []interface{}
}

Filter 数据库查询条件 Where

type Query

type Query struct {
	Ctx context.Context

	DB            *gorm.DB
	Filters       []Filter
	Count         *int64
	Order         string
	Limit, Offset int
}

Query 数据库查询请求

func (*Query) QueryDB

func (qr *Query) QueryDB(result interface{}) error

QueryDB 数据库查询 Limit == -1 时不分页

Jump to

Keyboard shortcuts

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