orm

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Db

type Db interface {
	Close()
	Exec(sql string) (lastInsertId int64, rowsAffected int64, err error)
	QueryOne(sql string, result interface{}) error
	Query(sql string, result interface{}) error
	Count(sql string, result interface{}) error
	BeginTx(ctx context.Context) (err error)
	Commit() error
	Rollback() error
	Hook() error
}

func NewMysql

func NewMysql(dsn string) (db Db, err error)

type Mysql

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

func (*Mysql) BeginTx

func (m *Mysql) BeginTx(ctx context.Context) (err error)

func (*Mysql) Close

func (m *Mysql) Close()

func (*Mysql) Commit

func (m *Mysql) Commit() error

func (*Mysql) Count

func (m *Mysql) Count(sqlStr string, result interface{}) error

func (*Mysql) Exec

func (m *Mysql) Exec(sqlStr string) (lastInsertId int64, rowsAffected int64, err error)

func (*Mysql) Hook

func (m *Mysql) Hook() error

func (*Mysql) Query

func (m *Mysql) Query(sqlStr string, result interface{}) (err error)

func (*Mysql) QueryOne

func (m *Mysql) QueryOne(sqlStr string, result interface{}) (err error)

func (*Mysql) Rollback

func (m *Mysql) Rollback() error

type NextOrm

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

func (*NextOrm) BeginTx

func (n *NextOrm) BeginTx(ctx context.Context) Orm

func (*NextOrm) Commit

func (n *NextOrm) Commit() Orm

func (*NextOrm) Count

func (n *NextOrm) Count(result interface{}) Orm

func (*NextOrm) Delete

func (n *NextOrm) Delete() Orm

func (*NextOrm) Error

func (n *NextOrm) Error() error

func (*NextOrm) Exec

func (n *NextOrm) Exec(format string, data ...interface{}) Orm

func (*NextOrm) Find

func (n *NextOrm) Find(result interface{}) Orm

func (*NextOrm) First

func (n *NextOrm) First(result interface{}) Orm

func (*NextOrm) Group

func (n *NextOrm) Group(group string) Orm

func (*NextOrm) Having

func (n *NextOrm) Having(format string, data ...interface{}) Orm

func (*NextOrm) Hook

func (n *NextOrm) Hook(action string, handler func()) Orm

func (*NextOrm) Join

func (n *NextOrm) Join(join string, data ...interface{}) Orm

func (*NextOrm) Last

func (n *NextOrm) Last(result interface{}) Orm

func (*NextOrm) LastInsertId

func (n *NextOrm) LastInsertId() int64

func (*NextOrm) Limit

func (n *NextOrm) Limit(limit int64) Orm

func (*NextOrm) Model

func (n *NextOrm) Model(model interface{}) Orm

Model 通过反射获取Table函数

func (*NextOrm) Offset

func (n *NextOrm) Offset(start int64) Orm

func (*NextOrm) Order

func (n *NextOrm) Order(order string) Orm

func (*NextOrm) Rollback

func (n *NextOrm) Rollback() Orm

func (*NextOrm) RowsAffected

func (n *NextOrm) RowsAffected() int64

func (*NextOrm) SQL added in v1.0.1

func (n *NextOrm) SQL() string

func (*NextOrm) Select

func (n *NextOrm) Select(field string) Orm

func (*NextOrm) Table

func (n *NextOrm) Table(table string) Orm

func (*NextOrm) Update

func (n *NextOrm) Update(model interface{}) Orm

func (*NextOrm) UpdateColumn

func (n *NextOrm) UpdateColumn(column string, value interface{}) Orm

func (*NextOrm) Updates

func (n *NextOrm) Updates(m map[string]interface{}) Orm

func (*NextOrm) Where

func (n *NextOrm) Where(format string, data ...interface{}) Orm

type Orm

type Orm interface {
	Table(table string) Orm
	Model(model interface{}) Orm
	Select(field string) Orm
	Join(join string, data ...interface{}) Orm
	Where(format string, data ...interface{}) Orm
	Find(result interface{}) Orm
	First(result interface{}) Orm
	Last(result interface{}) Orm
	Count(result interface{}) Orm
	Group(group string) Orm
	Having(format string, data ...interface{}) Orm
	Offset(start int64) Orm
	Limit(limit int64) Orm
	Order(order string) Orm
	Delete() Orm
	Updates(map[string]interface{}) Orm
	Update(model interface{}) Orm
	UpdateColumn(column string, value interface{}) Orm
	Exec(format string, data ...interface{}) Orm
	LastInsertId() int64
	RowsAffected() int64
	BeginTx(ctx context.Context) Orm
	Commit() Orm
	Rollback() Orm
	SQL() string
	Hook(action string, handler func()) Orm
	Error() error
}

func NewNextOrm

func NewNextOrm(db Db) Orm

Jump to

Keyboard shortcuts

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