db

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GormErrorFilter

func GormErrorFilter(err error) error

Remove error RecordNotFound

func IsGormNotFound

func IsGormNotFound(err error) bool

Check error is RecordNotFound

Types

type Paging

type Paging struct {
	CurrentPage     uint   // current page number
	ItemsNumPerPage uint   // list items number in per page
	ItemsTotal      uint   // rows number in database
	TotalPage       uint   // the count of all pages
	DbType          string // type of database,mysql or postgresql
}

func PagingGenerator

func PagingGenerator(currentPage, itemsNumPerPage, itemsTotal uint, DbType string) (paging Paging, err error)

func (*Paging) GetQueryBegin

func (p *Paging) GetQueryBegin() (begin uint)

func (*Paging) GetQueryLimit

func (p *Paging) GetQueryLimit() (sql string)

func (*Paging) SetData

func (p *Paging) SetData() (begin uint, err error)

Jump to

Keyboard shortcuts

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