db_lazy

package
v0.0.0-...-4ea7438 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERR_AlreadyStop               = errors.New("lazy_mysql already stop")
	ERR_NotImpletementOperateType = errors.New("lazy_mysql not implatement type")
)

Functions

This section is empty.

Types

type LazyMysql

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

func NewLazyMysql

func NewLazyMysql(orm *xorm.Engine, lazyTimeSecond int) *LazyMysql

func (*LazyMysql) Add

func (a *LazyMysql) Add(tb interface{}, operateType LazyOperateType, cols []string, condition string) error

if it added fail, need handle directly

func (*LazyMysql) AddSQL

func (a *LazyMysql) AddSQL(sql string, params ...interface{}) error

func (*LazyMysql) AddWithLimit

func (a *LazyMysql) AddWithLimit(tb interface{}, sql string, operateType LazyOperateType, cols []string, condition string, limit int) error

func (*LazyMysql) Exec

func (a *LazyMysql) Exec()

func (*LazyMysql) Flush

func (a *LazyMysql) Flush() error

func (*LazyMysql) IsRunning

func (a *LazyMysql) IsRunning() bool

func (*LazyMysql) Quit

func (a *LazyMysql) Quit()

Done:执行顺序需要确定 +排序 执行完成后删除元素 Done:锁粒度降低 todo:未做每次flush的执行数量限制, 暂不用

type LazyMysqlOperate

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

type LazyOperateType

type LazyOperateType int
const (
	LazyOperateType_Insert LazyOperateType = 1
	LazyOperateType_Update LazyOperateType = 2
	LazyOperateType_Delete LazyOperateType = 3
	LazyOperateType_SQL    LazyOperateType = 4
)

Jump to

Keyboard shortcuts

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