db

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderBy

type OrderBy []OrderByPair

OrderBy ORDER BY信息

func OneOrderBy

func OneOrderBy(name string, direction OrderByDirection) OrderBy

OneOrderBy 构建仅包含一对的orderBy

func TwoOrderBy

func TwoOrderBy(name0 string, direction0 OrderByDirection, name1 string, direction1 OrderByDirection) OrderBy

TwoOrderBy 构建包含两对的orderBy

func (OrderBy) String

func (ob OrderBy) String() string

type OrderByDirection

type OrderByDirection string

OrderByDirection SQL(ORDER BY)排序方向

var (
	// ASC 升序
	ASC OrderByDirection = "ASC"
	// DESC 降序
	DESC OrderByDirection = "DESC"
)

type OrderByPair

type OrderByPair struct {
	Name      string
	Direction OrderByDirection
}

OrderByPair ORDER BY对

func (OrderByPair) String

func (pair OrderByPair) String() string

type Page

type Page[INT constraints.Integer] struct {
	// contains filtered or unexported fields
}

Page 分页

func NewPage

func NewPage[INT constraints.Integer](pageNo, pageSize INT) (pg *Page[INT])

NewPage 返回分页实例

func (*Page[INT]) Limit

func (pg *Page[INT]) Limit() INT

Limit 返回分页大小

func (*Page[INT]) Offset

func (pg *Page[INT]) Offset() INT

Offset 返回分页记录偏移量

func (*Page[INT]) PageNo

func (pg *Page[INT]) PageNo() INT

PageNo 返回分页页号

func (*Page[INT]) PageSize

func (pg *Page[INT]) PageSize() INT

PageSize 返回分页大小

func (*Page[INT]) TotalPages

func (pg *Page[INT]) TotalPages(totalRecords INT) (totalPages INT)

TotalPages 返回总记录数对应的总分页数

Jump to

Keyboard shortcuts

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