mysql

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mysql

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

Mysql Mysql

func NewMysql

func NewMysql(connStr string, debug bool) *Mysql

NewMysql New Mysql

func NewMysql2

func NewMysql2(userName, password, host, dbName string, port int, debug bool) *Mysql

NewMysql2 New Mysql

func (*Mysql) CheckDuplication

func (m *Mysql) CheckDuplication(db *gorm.DB, query interface{}, args ...interface{}) (bool, error)

func (*Mysql) CheckDuplicationByTableName

func (m *Mysql) CheckDuplicationByTableName(db *gorm.DB, tableName string, query string, args ...interface{}) (bool, error)

func (*Mysql) Close

func (m *Mysql) Close()

Close 关闭

func (*Mysql) CreateWithCheckDuplication

func (m *Mysql) CreateWithCheckDuplication(info, query interface{}, args ...interface{}) (bool, error)

func (*Mysql) CreateWithCheckDuplicationByTableName

func (m *Mysql) CreateWithCheckDuplicationByTableName(tableName string, info, query interface{}, args ...interface{}) (bool, error)

func (*Mysql) CreateWithCheckDuplicationWithDB added in v1.2.0

func (m *Mysql) CreateWithCheckDuplicationWithDB(db *gorm.DB, info, query interface{}, args ...interface{}) (bool, error)

func (*Mysql) DB

func (m *Mysql) DB() *gorm.DB

DB DB

func (*Mysql) PageQuery

func (m *Mysql) PageQuery(db *gorm.DB, pageSize, pageIndex int64, order string, result interface{}) (records int64, pages int64, err error)

PageQuery 分页查询

func (*Mysql) PageQueryWithAssociations

func (m *Mysql) PageQueryWithAssociations(db *gorm.DB, pageSize, pageIndex int64, order string, result interface{}) (records int64, pages int64, err error)

PageQueryWithAssociations 分页查询

func (*Mysql) PageQueryWithPreload

func (m *Mysql) PageQueryWithPreload(db *gorm.DB, pageSize, pageIndex int64, order string, preload []string, result interface{}) (records int64, pages int64, err error)

PageQueryWithPreload 分页查询

func (*Mysql) UpdateWithCheckDuplication

func (m *Mysql) UpdateWithCheckDuplication(
	db *gorm.DB,
	info interface{},
	fullSaveAssociations bool,
	checkDuplicationQuery interface{},
	checkDuplicationParams ...interface{}) (bool, error)

func (*Mysql) UpdateWithCheckDuplicationAndOmit

func (m *Mysql) UpdateWithCheckDuplicationAndOmit(
	db *gorm.DB, info interface{},
	fullSaveAssociations bool,
	omit []string,
	checkDuplicationQuery interface{},
	checkDuplicationParams ...interface{}) (bool, error)

func (*Mysql) UpdateWithCheckDuplicationByTableName

func (m *Mysql) UpdateWithCheckDuplicationByTableName(db *gorm.DB, tableName string, info, query interface{}, args ...interface{}) (bool, error)

Jump to

Keyboard shortcuts

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