xxorm

package module
v0.0.0-...-abc123d Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: MIT Imports: 6 Imported by: 0

README

xxorm

extend of xorm library

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ASC  = PageOrder("asc")
	DESC = PageOrder("desc")
)

Order types

View Source
var MaxPageSize = uint64(200)

MaxPageSize .

Functions

func DuplicateKey

func DuplicateKey(db *xorm.Engine, err error) bool

DuplicateKey check if error is a duplicate key error

func Paged

func Paged(session *xorm.Session, page Page) *xorm.Session

Paged .

func RegisterDialect

func RegisterDialect(name string, dialect Dialect)

RegisterDialect .

Types

type Dialect

type Dialect interface {
	DuplicateKey(err error) bool
}

Dialect .

type Page

type Page struct {
	Offset  uint64    `binding:"required" json:"offset"`
	Size    uint64    `binding:"required" json:"size"`
	OrderBy string    `json:"orderby"`
	Order   PageOrder `json:"order"`
}

Page .

type PageOrder

type PageOrder string

PageOrder type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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