Versions in this module Expand all Collapse all v1 v1.1.5 Oct 28, 2022 Changes in this version + func GetSql(sql *strings.Builder, params []*entity.Condition) (string, []interface{}) + func GetUpdateSql(sql *strings.Builder, data map[string]interface{}, params []*entity.Condition) (string, []interface{}) + func SqlConvert(sql string, params map[string]interface{}) (string, []interface{}) + type DBTemplate struct + DataSourceName string + TxId uint64 + func GetDBTemplate(dataSourceName string) *DBTemplate + func GetDBTemplateTx(txId uint64, dataSourceName string) *DBTemplate + func (template *DBTemplate) Delete(tableName string, params []*entity.Condition) (sql.Result, error) + func (template *DBTemplate) DeleteTx(tableName string, params []*entity.Condition) (sql.Result, error) + func (template *DBTemplate) Exec(sql string, params []interface{}) (sql.Result, error) + func (template *DBTemplate) ExecByMap(sql string, paramsStruct map[string]interface{}) (sql.Result, error) + func (template *DBTemplate) ExecByTx(sql string, params []interface{}) (sql.Result, error) + func (template *DBTemplate) ExecByTxMap(sql string, paramsStruct map[string]interface{}) (sql.Result, error) + func (template *DBTemplate) ExecByTxNoParameters(sql string) (sql.Result, error) + func (template *DBTemplate) ExecNoParameters(sql string) (sql.Result, error) + func (template *DBTemplate) Insert(tableName string, data map[string]interface{}) (sql.Result, error) + func (template *DBTemplate) InsertTx(tableName string, data map[string]interface{}) (sql.Result, error) + func (template *DBTemplate) Select(tableName string, params []*entity.Condition) ([]map[string]string, error) + func (template *DBTemplate) SelectList(sql string, params []interface{}) ([]map[string]string, error) + func (template *DBTemplate) SelectListByMap(sql string, paramsStruct map[string]interface{}) ([]map[string]string, error) + func (template *DBTemplate) SelectListNoParameters(sql string) ([]map[string]string, error) + func (template *DBTemplate) SelectNoParameters(tableName string) ([]map[string]string, error) + func (template *DBTemplate) SelectOne(sql string, params []interface{}) (map[string]string, error) + func (template *DBTemplate) SelectOneByMap(sql string, paramsStruct map[string]interface{}) (map[string]string, error) + func (template *DBTemplate) SelectOneNoParameters(sql string) (map[string]string, error) + func (template *DBTemplate) SelectPage(sql string, pageParam entity.PageParam) (*entity.PageResult, error) + func (template *DBTemplate) SelectPageCustomCount(sql string, countSql string, pageParam entity.PageParam) (*entity.PageResult, error) + func (template *DBTemplate) Update(tableName string, data map[string]interface{}, params []*entity.Condition) (sql.Result, error) + func (template *DBTemplate) UpdateTx(tableName string, data map[string]interface{}, params []*entity.Condition) (sql.Result, error)