Documentation ¶
Index ¶
- func ErrorIsOrmNotFound(err error) bool
- type GormQuery
- func (q *GormQuery) Count() (count int64, err error)
- func (q *GormQuery) Create(value interface{}) (err error)
- func (q *GormQuery) CreateInBatches(value interface{}, batchSize int) (err error)
- func (q *GormQuery) Delete(model interface{}, conds ...interface{}) (err error)
- func (q *GormQuery) Distinct(args ...interface{}) *GormQuery
- func (q *GormQuery) Find(models interface{}, conds ...interface{}) (err error)
- func (q *GormQuery) First(model interface{}, conds ...interface{}) (err error)
- func (q *GormQuery) FirstOrCreate(model interface{}, conds ...interface{}) (err error)
- func (q *GormQuery) Group(name string) *GormQuery
- func (q *GormQuery) Having(query string, args ...interface{}) *GormQuery
- func (q *GormQuery) IncludeDeleted() *GormQuery
- func (q *GormQuery) InnerJoins(query string, args ...interface{}) *GormQuery
- func (q *GormQuery) Joins(query string, args ...interface{}) *GormQuery
- func (q *GormQuery) Limit(limit int) *GormQuery
- func (q *GormQuery) Not(query interface{}, args ...interface{}) *GormQuery
- func (q *GormQuery) Offset(offset int) *GormQuery
- func (q *GormQuery) Or(query interface{}, args ...interface{}) *GormQuery
- func (q *GormQuery) Order(value interface{}) *GormQuery
- func (q *GormQuery) Pluck(column string, model interface{}) (err error)
- func (q *GormQuery) Save(model interface{}) (err error)
- func (q *GormQuery) Scan(model interface{}) (err error)
- func (q *GormQuery) Select(query interface{}, args ...interface{}) *GormQuery
- func (q *GormQuery) SoftDelete(model interface{}, conds ...interface{}) (err error)
- func (q *GormQuery) Update(data interface{}) (err error)
- func (q *GormQuery) Where(query interface{}, args ...interface{}) *GormQuery
- func (q *GormQuery) WithPager(p *utilHttp.Paginator) *GormQuery
- func (q *GormQuery) WithRelate(query string, args ...interface{}) *GormQuery
- type OrmModel
- type OrmModelGormBase
- type OrmMysqlJsonSliceString
- type UtilGorm
- func NewUtilGormClickHouse(host string, port int, user string, password string, dbName string, ...) (utilOrm *UtilGorm, err error)
- func NewUtilGormMysql(host string, port int, user string, password string, dbName string, ...) (utilOrm *UtilGorm, err error)
- func NewUtilGormSqlite(dsn string, tablePrefix string) (utilOrm *UtilGorm, err error)
- func (ug *UtilGorm) AutoMigrate(dst ...interface{}) (err error)
- func (ug *UtilGorm) Begin(opts ...*sql.TxOptions) (err error)
- func (ug *UtilGorm) Clauses(conds ...clause.Expression) *UtilGorm
- func (ug *UtilGorm) Clone() *UtilGorm
- func (ug *UtilGorm) Commit() (err error)
- func (ug *UtilGorm) Debug(debug bool) *UtilGorm
- func (ug *UtilGorm) IncludeDeleted() *UtilGorm
- func (ug *UtilGorm) Migrator() gorm.Migrator
- func (ug *UtilGorm) ModelDelete(model interface{}) error
- func (ug *UtilGorm) ModelQuery(model interface{}, orderBy *[]string) *GormQuery
- func (ug *UtilGorm) ModelRead(model interface{}) error
- func (ug *UtilGorm) ModelRelatedAppend(model interface{}, related string, values ...interface{}) (err error)
- func (ug *UtilGorm) ModelRelatedClear(model interface{}, related string) (err error)
- func (ug *UtilGorm) ModelRelatedDelete(model interface{}, related string, values ...interface{}) (err error)
- func (ug *UtilGorm) ModelRelatedLoad(model interface{}, related string, conds ...interface{}) (err error)
- func (ug *UtilGorm) ModelRelatedReplace(model interface{}, related string, values ...interface{}) (err error)
- func (ug *UtilGorm) ModelSave(model interface{}) error
- func (ug *UtilGorm) ModelTableName(model interface{}) (name string)
- func (ug *UtilGorm) Original() *gorm.DB
- func (ug *UtilGorm) Raw(sql string, values ...interface{}) (err error)
- func (ug *UtilGorm) Rollback() (err error)
- func (ug *UtilGorm) RollbackTo(name string) (err error)
- func (ug *UtilGorm) SavePoint(name string) (err error)
- func (ug *UtilGorm) Scopes(funcs ...func(*gorm.DB) *gorm.DB) *UtilGorm
- func (ug *UtilGorm) Select(query interface{}, args ...interface{}) *UtilGorm
- func (ug *UtilGorm) SerLoggerWriter(writer io.Writer) *UtilGorm
- func (ug *UtilGorm) Session(config *gorm.Session) *UtilGorm
- func (ug *UtilGorm) Set(key string, value interface{}) *UtilGorm
- func (ug *UtilGorm) TableName(table string) (name string)
- func (ug *UtilGorm) TableQuery(tableName string, orderBy *[]string, args ...interface{}) *GormQuery
- func (ug *UtilGorm) Where(query interface{}, args ...interface{}) *UtilGorm
- func (ug *UtilGorm) WithRelate(query string, args ...interface{}) *UtilGorm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorIsOrmNotFound ¶
Types ¶
type GormQuery ¶
type GormQuery struct {
// contains filtered or unexported fields
}
func (*GormQuery) CreateInBatches ¶
func (*GormQuery) FirstOrCreate ¶
func (*GormQuery) IncludeDeleted ¶
func (*GormQuery) InnerJoins ¶
func (*GormQuery) SoftDelete ¶
func (*GormQuery) WithRelate ¶
type OrmModelGormBase ¶
type OrmModelGormBase struct { Id string `gorm:"primaryKey;size:36" json:"id,omitempty" form:"id"` CreatedAt time.Time `gorm:"autoCreateTime;<-:create;index:index_created_at" json:"created_at" form:"-"` UpdatedAt time.Time `gorm:"autoUpdateTime:nano;index:index_updated_at" json:"updated_at" form:"-"` DeletedAt gorm.DeletedAt `json:"deleted_at" form:"-"` }
func (*OrmModelGormBase) BeforeCreate ¶
func (om *OrmModelGormBase) BeforeCreate(tx *gorm.DB) (err error)
func (*OrmModelGormBase) GetPrimaryKey ¶
func (om *OrmModelGormBase) GetPrimaryKey() string
func (*OrmModelGormBase) GetPrimaryKeyFiledName ¶
func (om *OrmModelGormBase) GetPrimaryKeyFiledName() string
func (*OrmModelGormBase) GetPrimaryKeyFiledNameSnake ¶
func (om *OrmModelGormBase) GetPrimaryKeyFiledNameSnake() string
type OrmMysqlJsonSliceString ¶
type OrmMysqlJsonSliceString []string
func (*OrmMysqlJsonSliceString) Scan ¶
func (j *OrmMysqlJsonSliceString) Scan(value interface{}) error
实现 sql.Scanner 接口,Scan 将 value 扫描至 Jsonb
type UtilGorm ¶
type UtilGorm struct {
// contains filtered or unexported fields
}
func NewUtilGormClickHouse ¶
func NewUtilGormMysql ¶
func NewUtilGormSqlite ¶
func (*UtilGorm) AutoMigrate ¶
func (*UtilGorm) IncludeDeleted ¶
func (*UtilGorm) ModelDelete ¶
func (*UtilGorm) ModelQuery ¶
func (*UtilGorm) ModelRelatedAppend ¶
func (*UtilGorm) ModelRelatedClear ¶
func (*UtilGorm) ModelRelatedDelete ¶
func (*UtilGorm) ModelRelatedLoad ¶
func (*UtilGorm) ModelRelatedReplace ¶
func (*UtilGorm) ModelTableName ¶
func (*UtilGorm) RollbackTo ¶
func (*UtilGorm) TableQuery ¶
func (*UtilGorm) WithRelate ¶
Click to show internal directories.
Click to hide internal directories.