sdao

package
v0.0.0-...-0c396f5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Tag       = "gorm"
	TableName = "TableName"
)
View Source
var Msdb *mssql.DB
View Source
var RC *cache.RC

Functions

func Begin

func Begin() (*mssql.Tx, error)

func ClearCache

func ClearCache(tablename string, id interface{})

func ClearCacheByIDs

func ClearCacheByIDs(tableName string, ids ...interface{})

func ClearListCache

func ClearListCache(tablename string)

func ClearOneCache

func ClearOneCache(tablename string, id interface{})

func Count

func Count(table string, q *qs.QuerySet) (num int)

func CountCache

func CountCache(tablename string, q *qs.QuerySet) int

CountCache 将count存入缓存

func Countsql

func Countsql(sql string, q *qs.QuerySet) (num int)

func CountsqlC

func CountsqlC(sql string, params ...interface{}) (num int)

func Exec

func Exec(sql string, params ...interface{}) (sql.Result, error)

func Find

func Find(q *qs.QuerySet, obj interface{}) (err error)

func FindByID

func FindByID(id interface{}, obj interface{}) (err error)

func FindByIDCache

func FindByIDCache(id interface{}, obj interface{}) (err error)

func FindByKey

func FindByKey(key string, value interface{}, obj interface{}) (err error)

func Finds

func Finds(q *qs.QuerySet, obj interface{}) (err error)

func FindsCache

func FindsCache(q *qs.QuerySet, obj interface{}) (err error)

func GetCacheKey

func GetCacheKey(table, suffix string, id interface{}) string

func GetTableName

func GetTableName(t reflect.Type) (table, pkkey string)

func Init

func Init()

Init load DB

func Insert

func Insert(res interface{}) error

func InsertOrUpdate

func InsertOrUpdate(res interface{}) (string, error)

func Query

func Query(sql string, params ...interface{}) (*sql.Rows, error)

func QueryByQs

func QueryByQs(table, pkkey string, q *qs.QuerySet, data interface{}) error

func Sum

func Sum(table, key string, q *qs.QuerySet) (sumnum float64)

func SumSql

func SumSql(sql string, q *qs.QuerySet) (sumnum float64)

func SumSqlC

func SumSqlC(sql string, params ...interface{}) (sumnum float64)

func Update

func Update(res interface{}) (string, error)

Types

type Time

type Time struct{}

func (*Time) Decode

func (wt *Time) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func (*Time) Encode

func (wt *Time) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream)

func (*Time) IsEmpty

func (wt *Time) IsEmpty(ptr unsafe.Pointer) bool

Jump to

Keyboard shortcuts

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