txorm

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cache struct {
	Set    *txormSetting
	Engine *xorm.Engine
}

Functions

func Affairs

func Affairs(f func(sss *xorm.Session, err error) error) error

执行事务

func GetById

func GetById(id int64, v interface{}) error

查询一条数据

func Insert

func Insert(v ...interface{}) error

插入数据

func Page

func Page(pageNo int, pageSize int, list interface{}, f func(s *xorm.Engine) *xorm.Session) (int64, error)

查询一组数据

func RemoveId

func RemoveId(id int64, v interface{}) error

删除数据

func SyncTable

func SyncTable(v interface{})

同步表结构

func UpdateId

func UpdateId(id int64, v interface{}, kyes ...string) error

修改数据

Types

type IdModel

type IdModel struct {
	Id int64 `xorm:"pk autoincr" mode:"all"`
}

id查询

type PageModel

type PageModel struct {
	PageNo   int `params:"pageNo"`
	PageSize int `params:"pageSize"`
}

分页查询模型

type Txm

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

func GetTxm

func GetTxm(c *xorm.Session) *Txm

获取连接对象

func (*Txm) GetById

func (t *Txm) GetById(id int64, v interface{}) error

func (*Txm) Insert

func (t *Txm) Insert(v ...interface{}) error

func (*Txm) Page

func (t *Txm) Page(pageNo int, pageSize int, list interface{}, f func(s *xorm.Session) *xorm.Session) (int64, error)

func (*Txm) RemoveId

func (t *Txm) RemoveId(id int64, v interface{}) error

func (*Txm) UpdateId

func (t *Txm) UpdateId(id int64, v interface{}, kyes ...string) error

Jump to

Keyboard shortcuts

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