dbx

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTableSchemas

func BuildTableSchemas()

func CheckRecordTotal

func CheckRecordTotal(qb *queryBuilder, countField ...string) int

func DebugModeEnabled

func DebugModeEnabled(args ...bool) bool

func DeleteBySql

func DeleteBySql(query string, args ...interface{}) (int64, error)

func ExecuteSql

func ExecuteSql(query string, args ...interface{}) error

func GetTableSchemas

func GetTableSchemas() map[string][]tableFieldInfo

func InsertBySql

func InsertBySql(query string, args ...interface{}) (int64, error)

func IsFieldValueExists

func IsFieldValueExists(tblName, fieldName string, fieldValue interface{}, pkValue ...interface{}) bool

func Raw

func Raw(expr string) *rawSql

func SelectBySql

func SelectBySql(query string, args ...interface{}) ([]map[string]interface{}, error)

func Table

func Table(name string) *queryBuilder

func Transations

func Transations(fn func(tx *sql.Tx) error, opts ...*sql.TxOptions) error

func TxDeleteBySql

func TxDeleteBySql(tx *sql.Tx, query string, args ...interface{}) (int64, error)

func TxExecuteSql

func TxExecuteSql(tx *sql.Tx, query string, args ...interface{}) error

func TxInsertBySql

func TxInsertBySql(tx *sql.Tx, query string, args ...interface{}) (int64, error)

func TxSelectBySql

func TxSelectBySql(tx *sql.Tx, query string, args ...interface{}) ([]map[string]interface{}, error)

func TxUpdateBySql

func TxUpdateBySql(tx *sql.Tx, query string, args ...interface{}) (int64, error)

func UpdateBySql

func UpdateBySql(query string, args ...interface{}) (int64, error)

func WithLogger

func WithLogger(arg0 logx.Logger)

func WithPool

func WithPool(arg0 *sql.DB)

Types

type DbException

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

func NewDbException

func NewDbException(errorTips string) DbException

func (DbException) Error

func (ex DbException) Error() string

type NoDataException

type NoDataException struct {
}

func NewNoDataException

func NewNoDataException() NoDataException

func (NoDataException) Error

func (ex NoDataException) Error() string

Jump to

Keyboard shortcuts

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