Documentation ¶
Index ¶
- func Create() *srDb
- func GetUpdateHelper() abs.DbGetUpdateHelper
- func NewUpdateHelper() abs.DbUpdateHelper
- type Repo
- func (slf *Repo[T]) Count(logc *clog.Instance, whereQuery, endQuery string, wherePars ...interface{}) (int, error)
- func (slf *Repo[T]) Delete(logc *clog.Instance, whereQuery string, wherePars ...interface{}) error
- func (slf *Repo[T]) Execute(logc *clog.Instance, sqlQuery string, sqlPars ...interface{}) error
- func (slf *Repo[T]) GenerateParamSigns(columnNames string) (paramSign string)
- func (slf *Repo[T]) GetData(logc *clog.Instance, whereQuery string, endQuery string, ...) (*T, error)
- func (slf *Repo[T]) GetDatas(logc *clog.Instance, whereQuery string, endQuery string, ...) ([]T, error)
- func (slf *Repo[T]) Insert(logc *clog.Instance, sqlPars ...interface{}) error
- func (slf *Repo[T]) InsertRID(logc *clog.Instance, sqlPars ...interface{}) (*int64, error)
- func (slf *Repo[T]) OnUnsafe(unsafe *model.DbUnsafeSelectError)
- func (slf *Repo[T]) RawCount(logc *clog.Instance, query string, pars ...interface{}) (int, error)
- func (slf *Repo[T]) Select(logc *clog.Instance, query string, args ...interface{}) ([]T, error)
- func (slf *Repo[T]) SelectFirst(logc *clog.Instance, query string, args ...interface{}) (*T, error)
- func (slf *Repo[T]) SetColumnNames(names string)
- func (slf *Repo[T]) SetInsertColumnNames(names string)
- func (slf *Repo[T]) TxCount(logc *clog.Instance, tx abs.DbTx, whereQuery, endQuery string, ...) (int, error)
- func (slf *Repo[T]) TxDelete(logc *clog.Instance, tx abs.DbTx, whereQuery string, wherePars ...interface{}) error
- func (slf *Repo[T]) TxExecute(logc *clog.Instance, tx abs.DbTx, sqlQuery string, sqlPars ...interface{}) error
- func (slf *Repo[T]) TxGetData(logc *clog.Instance, tx abs.DbTx, whereQuery string, endQuery string, ...) (*T, error)
- func (slf *Repo[T]) TxGetDatas(logc *clog.Instance, tx abs.DbTx, whereQuery string, endQuery string, ...) ([]T, error)
- func (slf *Repo[T]) TxInsert(logc *clog.Instance, tx abs.DbTx, sqlPars ...interface{}) error
- func (slf *Repo[T]) TxInsertRID(logc *clog.Instance, tx abs.DbTx, sqlPars ...interface{}) (*int64, error)
- func (slf *Repo[T]) TxRawCount(logc *clog.Instance, tx abs.DbTx, query string, pars ...interface{}) (int, error)
- func (slf *Repo[T]) TxSelect(logc *clog.Instance, tx abs.DbTx, query string, args ...interface{}) ([]T, error)
- func (slf *Repo[T]) TxSelectFirst(logc *clog.Instance, tx abs.DbTx, query string, args ...interface{}) (*T, error)
- func (slf *Repo[T]) TxUpdate(logc *clog.Instance, tx abs.DbTx, keyVals map[string]interface{}, ...) error
- func (slf *Repo[T]) Update(logc *clog.Instance, keyVals map[string]interface{}, whereQuery string, ...) error
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUpdateHelper ¶ added in v1.1.21
func GetUpdateHelper() abs.DbGetUpdateHelper
func NewUpdateHelper ¶ added in v1.1.21
func NewUpdateHelper() abs.DbUpdateHelper
Types ¶
type Repo ¶
type Repo[T any] struct { DbInstance abs.DbInstance TableName string ColumnNames string InsertColumnNames string // if empty then use columnNames ParamSigns string InsertParamSign string // if empty then use paramSigns PrintUnsafeErr bool }
func (*Repo[T]) GenerateParamSigns ¶
func (*Repo[T]) OnUnsafe ¶
func (slf *Repo[T]) OnUnsafe(unsafe *model.DbUnsafeSelectError)
func (*Repo[T]) SelectFirst ¶ added in v1.1.15
func (*Repo[T]) SetColumnNames ¶ added in v1.0.3
func (*Repo[T]) SetInsertColumnNames ¶ added in v1.0.3
func (*Repo[T]) TxGetDatas ¶ added in v1.1.18
func (*Repo[T]) TxInsertRID ¶ added in v1.1.18
func (*Repo[T]) TxRawCount ¶ added in v1.1.18
func (*Repo[T]) TxSelectFirst ¶ added in v1.1.18
Click to show internal directories.
Click to hide internal directories.