db

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBClient

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

DBClient DBClient

func NewDBClient

func NewDBClient(db *gorm.DB, debug bool) *DBClient

NewDBClient New DBClient

func (*DBClient) CheckDuplication

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

func (*DBClient) CheckDuplicationByTableName

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

func (*DBClient) Close

func (m *DBClient) Close()

Close 关闭

func (*DBClient) CreateWithCheckDuplication

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

func (*DBClient) CreateWithCheckDuplicationByTableName

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

func (*DBClient) CreateWithCheckDuplicationWithDB

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

func (*DBClient) DB

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

DB DB

func (*DBClient) PageQuery

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

PageQuery 分页查询

func (*DBClient) PageQueryWithAssociations

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

PageQueryWithAssociations 分页查询

func (*DBClient) PageQueryWithPreload

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

PageQueryWithPreload 分页查询

func (*DBClient) UpdateWithCheckDuplication

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

func (*DBClient) UpdateWithCheckDuplicationAndOmit

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

func (*DBClient) UpdateWithCheckDuplicationByTableName

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

type DBClientInterface

type DBClientInterface interface {
	Close()
	DB() *gorm.DB
	PageQuery(db *gorm.DB, pageSize, pageIndex int64, order string, result interface{}) (records int64, pages int64, err error)
	PageQueryWithPreload(db *gorm.DB, pageSize, pageIndex int64, order string, preload []string, result interface{}) (records int64, pages int64, err error)
	PageQueryWithAssociations(db *gorm.DB, pageSize, pageIndex int64, order string, result interface{}) (records int64, pages int64, err error)
	CheckDuplication(db *gorm.DB, query interface{}, args ...interface{}) (bool, error)
	CheckDuplicationByTableName(db *gorm.DB, tableName string, query string, args ...interface{}) (bool, error)
	CreateWithCheckDuplication(info, query interface{}, args ...interface{}) (bool, error)
	CreateWithCheckDuplicationWithDB(db *gorm.DB, info, query interface{}, args ...interface{}) (bool, error)
	CreateWithCheckDuplicationByTableName(tableName string, info, query interface{}, args ...interface{}) (bool, error)
	UpdateWithCheckDuplication(
		db *gorm.DB,
		info interface{},
		fullSaveAssociations bool,
		checkDuplicationQuery interface{},
		checkDuplicationParams ...interface{}) (bool, error)
	UpdateWithCheckDuplicationAndOmit(
		db *gorm.DB, info interface{},
		fullSaveAssociations bool,
		omit []string,
		checkDuplicationQuery interface{},
		checkDuplicationParams ...interface{}) (bool, error)
	UpdateWithCheckDuplicationByTableName(db *gorm.DB, tableName string, info, query interface{}, args ...interface{}) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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