Documentation ¶
Index ¶
- func Create(db *gorm.DB, in interface{}) xerror.IError
- func Delete(db *gorm.DB, table interface{}, options ...Option) xerror.IError
- func DoOption(db *gorm.DB, opts ...Option) *gorm.DB
- func GetDB() *gorm.DB
- func GetDBWithCtx(ctx context.Context) *gorm.DB
- func GetFirstRecord(db *gorm.DB, in interface{}, options ...Option) xerror.IError
- func GetListRecord(db *gorm.DB, in interface{}, options ...Option) xerror.IError
- func Initialize() (err error)
- func NewDbError(err error) xerror.IError
- func NewOrm(dsn string) (*gorm.DB, error)
- func ParseOrmDsn(dsn string) (gorm.Dialector, error)
- func Updates(db *gorm.DB, in interface{}, options ...Option) xerror.IError
- type BaseModel
- type BasePageReq
- type BasePageResp
- type DbError
- type Option
- type SimpleBaseModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFirstRecord ¶
func GetListRecord ¶
func Initialize ¶
func Initialize() (err error)
func NewDbError ¶
Types ¶
type BasePageReq ¶
type BasePageResp ¶
type BasePageResp struct { Count int64 `json:"count"` Data interface{} `json:"data"` }
func GetPageListRecord ¶
func GetPageListRecord2 ¶
func GetPageListRecord2(db *gorm.DB, page *BasePageReq, in interface{}, options ...Option) (*BasePageResp, xerror.IError)
Click to show internal directories.
Click to hide internal directories.