Documentation ¶
Index ¶
- func CreateObject(value interface{}) error
- func GetDB() *gorm.DB
- func InitConnDB(dbType string, dbConn string) error
- func Ping() error
- func QueryRow(sqlStr string) (*sql.Row, error)
- func QueryRows(sqlStr string) (*sql.Rows, error)
- func SearchObject(objectPtr interface{}, wheres map[string]interface{}, out interface{}) error
- func SearchObjectByIn(objectPtr interface{}, wheres map[string]interface{}, ...) error
- func SearchObjectByOrder(objectPtr interface{}, wheres map[string]interface{}, ...) error
- func SearchObjectPreload(objectPtr interface{}, tableName string, wheres map[string]interface{}, ...) error
- func SearchSelectPreload(objectPtr interface{}, tableName, selectValue string, ...) error
- func SearchTableCount(tableName, countField, wheres string) (int, error)
- func SearchTableSum(tableName, countField, wheres string) (float64, error)
- func SetLogger(logger *log.Logger)
- func SetSQLMode(enable bool)
- func UpdateObject(objectPtr interface{}, wheres, updates map[string]interface{}) error
- func WriteError(sqlStr string, err error)
- func WriteLog(sqlStr string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateObject ¶
func CreateObject(value interface{}) error
func InitConnDB ¶
func SearchObject ¶
func SearchObjectByIn ¶
func SearchObjectByOrder ¶
func SearchObjectPreload ¶
func SearchObjectPreload(objectPtr interface{}, tableName string, wheres map[string]interface{}, preloads []string, joins []string) error
note: return check gorm.ErrRecordNotFound
func SearchSelectPreload ¶
func SearchSelectPreload(objectPtr interface{}, tableName, selectValue string, wheres map[string]interface{}, preloads []string, joins []string) error
note: return check gorm.ErrRecordNotFound
func SearchTableCount ¶
func SearchTableSum ¶
func UpdateObject ¶
updates maybe use gorm.Expr()
func WriteError ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.