CoreSQL

package
v5.1.43 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTimeHaveData

func CheckTimeHaveData(d time.Time) bool

CheckTimeHaveData 检查sql语句的delete类型时间是否存在数据

func CheckTimeThanNow

func CheckTimeThanNow(d time.Time) bool

CheckTimeThanNow 检查特定时间是否存在或是否满足当前时间?

func CreateMore

func CreateMore(db *sqlx.DB, query string, args []interface{}) (err error)

CreateMore 快速创建多条

func CreateOne

func CreateOne(db *sqlx.DB, query string, args interface{}) (result sql.Result, err error)

CreateOne 快速创建

func CreateOneAndData

func CreateOneAndData(db *sqlx.DB, tableName string, query string, args interface{}, data interface{}) (err error)

CreateOneAndData 获取并反射数据集

func CreateOneAndID

func CreateOneAndID(db *sqlx.DB, query string, args interface{}) (lastID int64, err error)

CreateOneAndID 带有反馈id的创建 本方法将在query尾巴位置插入获取ID的方法,所以请确保尾部语法封闭

func DeleteAll

func DeleteAll(db *sqlx.DB, tableName string, where string, args interface{}) (result sql.Result, err error)

DeleteAll 清理所有符合条件的

func DeleteAllSoft

func DeleteAllSoft(db *sqlx.DB, tableName string, where string, value interface{}) (result sql.Result, err error)

DeleteAllSoft 通用软删除

func DeleteOne

func DeleteOne(db *sqlx.DB, tableName string, fieldName string, value interface{}) (result sql.Result, err error)

DeleteOne 通用删除处理

func DeleteOneSoft

func DeleteOneSoft(db *sqlx.DB, tableName string, fieldName string, value interface{}) (result sql.Result, err error)

DeleteOneSoft 通用软删除

func GetAllAvg

func GetAllAvg(db *sqlx.DB, tableName string, fieldsName string, where string, whereArgs ...interface{}) (count float64, err error)

GetAllAvg 获取平均行数

func GetAllAvgMap

func GetAllAvgMap(db *sqlx.DB, tableName string, fieldsName string, where string, whereArgs interface{}) (count float64, err error)

GetAllAvgMap 获取平均行数,map方式

func GetAllAvgMapTables

func GetAllAvgMapTables(db *sqlx.DB, fieldsName string, query string, whereArgs interface{}) (count float64, err error)

GetAllAvgMapTables 混合多表查询方法集合

func GetAllCount

func GetAllCount(db *sqlx.DB, tableName string, fieldsName string, where string, whereArgs ...interface{}) (count int64, err error)

GetAllCount 获取总行数

func GetAllCountMap

func GetAllCountMap(db *sqlx.DB, tableName string, fieldsName string, where string, whereArgs interface{}) (count int64, err error)

GetAllCountMap 获取总行数,map方式

func GetAllCountMapTables

func GetAllCountMapTables(db *sqlx.DB, fieldsName string, query string, whereArgs interface{}) (count int64, err error)

GetAllCountMapTables 混合多表查询方法集合

func GetAllSumMap

func GetAllSumMap(db *sqlx.DB, tableName string, fieldsName string, where string, whereArgs interface{}) (count int64, err error)

GetAllSumMap 获取合计数,map方式

func GetDeleteSQL

func GetDeleteSQL(isRemove bool, where string) string

GetDeleteSQL 获取删除或尚未删除的sql语句部分

func GetDeleteSQLField

func GetDeleteSQLField(isRemove bool, where string, field string) string

func GetList

func GetList(db *sqlx.DB, data interface{}, query string, maps map[string]interface{}) (err error)

GetList 遍历和解析多结构体

func GetListAndCount

func GetListAndCount(db *sqlx.DB, data interface{}, tableName string, fieldName string, query string, where string, maps map[string]interface{}) (count int64, err error)

GetListAndCount 带count的处理机制

func GetListPageAndCount

func GetListPageAndCount(db *sqlx.DB, data interface{}, tableName string, fieldName string, query string, where string, maps map[string]interface{}, pages *CoreSQLPages.ArgsDataList, filterSort []string) (count int64, err error)

GetListPageAndCount 带有分页方法的设计GetListPageAndCount

func GetListPageAndCountArgs

func GetListPageAndCountArgs(db *sqlx.DB, data interface{}, tableName string, fieldName string, query string, where string, pages *CoreSQLPages.ArgsDataList, filterSort []string, args ...interface{}) (count int64, err error)

func GetNeedChange

func GetNeedChange(where string, fieldName string, need bool, open bool) string

GetNeedChange 组合某个开关类选项

func GetNeedChangeNow

func GetNeedChangeNow(where string, fieldName string, need bool, open bool) string

func GetOne

func GetOne(db *sqlx.DB, data interface{}, query string, maps map[string]interface{}) (err error)

GetOne 通用解析程序

func GetWhereInt64

func GetWhereInt64(where string, maps map[string]interface{}, fieldName string, param int64) (string, map[string]interface{})

GetWhereInt64 检查某个数字参数

func LastRows

func LastRows(tx *sqlx.Tx, err error) error

LastRows 事务关系尾部封装

func LastRowsAffected

func LastRowsAffected(tx *sqlx.Tx, result sql.Result, err error) error

LastRowsAffected 事务关系尾封装,带影响行判断

func LastRowsAffectedCreate

func LastRowsAffectedCreate(tx *sqlx.Tx, stmt *sqlx.NamedStmt, args interface{}, err error) (int64, error)

LastRowsAffectedCreate 带有ID的创建尾部

func UpdateOne

func UpdateOne(db *sqlx.DB, query string, args interface{}) (result sql.Result, err error)

UpdateOne 快速更新

func UpdateOneSoft

func UpdateOneSoft(db *sqlx.DB, query string, args interface{}) (result sql.Result, err error)

UpdateOneSoft 支持软删除的更新 请确保query where部分为封闭设计,避免影响到追加的软删除指令标记

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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