driver

package
v0.0.0-...-b6d1c84 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gorm

type Gorm struct {
	// contains filtered or unexported fields
}

Gorm 查询

func NewGormDriver

func NewGormDriver(conn *gorm.DB) *Gorm

NewGormDriver gorm 分页实现

func (*Gorm) Count

func (orm *Gorm) Count() int64

Count 计算指定查询条件的总数量

func (*Gorm) Find

func (orm *Gorm) Find(data interface{})

Find 从数据库查询数据

func (*Gorm) Index

func (orm *Gorm) Index(index string)

Index table 表名

func (*Gorm) Limit

func (orm *Gorm) Limit(limit int)

Limit 每页数量

func (*Gorm) Range

func (orm *Gorm) Range(r pager.Range)

Range 范围查询条件

func (*Gorm) SetTyp

func (orm *Gorm) SetTyp(typ reflect.Type)

SetTyp sql 对数据查询的类型不敏感

func (*Gorm) Skip

func (orm *Gorm) Skip(skip int)

Skip 跳过数量

func (*Gorm) Sort

func (orm *Gorm) Sort(sortInfo []pager.SortInfo)

Sort 排序

func (*Gorm) Where

func (orm *Gorm) Where(kv pager.Where)

Where 构建查询条件

func (*Gorm) WithDB

func (orm *Gorm) WithDB(db *gorm.DB) *Gorm

WithDB 选择另外的数据库

Jump to

Keyboard shortcuts

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