db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExist

func CheckExist(model interface{}, query string, args interface{}, ex *exception.Error)

通过条件判断是否存在数据(抛异常)

func CheckExistByKey

func CheckExistByKey(model interface{}, val interface{}, ex *exception.Error)

通过主键值是否存在数据(抛异常)

func GetList

func GetList(model interface{}, cols string, where map[string]interface{}, size int, idx int)

func GetMap

func GetMap(model interface{}, cols string, where map[string]interface{}) map[string]interface{}

func GetMaps

func GetMaps(model interface{}, cols string, where map[string]interface{}, size int, idx int) []map[string]interface{}

func GetRowByKey

func GetRowByKey(model interface{}, cols string, val interface{}, ex *exception.Error)

func IsExist

func IsExist(model interface{}, query string, args interface{}) bool

通过条件判断是否存在数据(返回boolean)

func IsExistByKey

func IsExistByKey(model interface{}, val interface{}) bool

通过主键值是否存在数据(返回boolean)

Types

type DefaultModel

type DefaultModel struct {
	ID      int64 `db:"column:id;primaryKey;autoIncrease;"`
	AddTime int64 `db:"column:add_time;autoCreateTime:milli"`
	ModTime int64 `db:"column:mod_time;autoUpdateTime:milli"`
}

func (*DefaultModel) GetRow

func (db *DefaultModel) GetRow(where interface{})

func (*DefaultModel) IsExistById

func (db *DefaultModel) IsExistById(val interface{})

func (DefaultModel) TableName

func (DefaultModel) TableName() string

Jump to

Keyboard shortcuts

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