Versions in this module Expand all Collapse all v1 v1.1.1 Mar 26, 2024 v1.1.0 Mar 26, 2024 Changes in this version + const DATA_PERMISSION_ALL + const DATA_PERMISSION_ONESELF + const DATA_PERMISSION_ONLY_CUSTOM + const DATA_PERMISSION_ONLY_DEPT + const DATA_PERMISSION_ONLY_DEPT_ALL + const SHADING_KEY + const SHADING_MODEL_DB + const SHADING_MODEL_NOT + const SHADING_MODEL_ONE + const SHADING_MODEL_TABLE + const TX_CONDITION_BUILD_KEY + const TX_DATA_PERMISSION_KEY + const TX_SHADING_MODEL_KEY + const TX_SHADING_TABLE_KEY + const TX_SUB_QUERY_COLUMN_KEY + var FlagActived = 0 + var FlagDeleted = 1 + func CopyCtx(oldTx, newTx *gorm.DB) + func GetShardingKey(tx *gorm.DB) (sk string) type Condition + IsSharding bool + ShardingKey string + type DataPermissionIntCtx struct + DataPermission int64 + DataPermissionScope []int64 + DataPermissionType int8 + type DataPermissionIntModel struct + DataPermission int64 + type DataPermissionStringCtx struct + DataPermission string + DataPermissionScope []string + DataPermissionType int8 + type DataPermissionStringModel struct + DataPermission string + type DeleteParams struct + ID []uint + type DeletedAt uint + func (DeletedAt) DeleteClauses(f *schema.Field) []clause.Interface + func (DeletedAt) QueryClauses(f *schema.Field) []clause.Interface + func (DeletedAt) UpdateClauses(f *schema.Field) []clause.Interface + type ShardingModel struct + ShadingKey string + func (m *ShardingModel) BeforeCreate(tx *gorm.DB) error + func (m *ShardingModel) BeforeDelete(tx *gorm.DB) error + func (m *ShardingModel) BeforeUpdate(tx *gorm.DB) error + func (m *ShardingModel) TableName(table string) string + type SoftDeleteDeleteClause struct + DeleteAtField *schema.Field + Field *schema.Field + Flag bool + TimeType schema.TimeType + func (sd SoftDeleteDeleteClause) Build(clause.Builder) + func (sd SoftDeleteDeleteClause) MergeClause(*clause.Clause) + func (sd SoftDeleteDeleteClause) ModifyStatement(stmt *gorm.Statement) + func (sd SoftDeleteDeleteClause) Name() string + type SoftDeleteQueryClause struct + Field *schema.Field + func (sd SoftDeleteQueryClause) Build(clause.Builder) + func (sd SoftDeleteQueryClause) MergeClause(*clause.Clause) + func (sd SoftDeleteQueryClause) ModifyStatement(stmt *gorm.Statement) + func (sd SoftDeleteQueryClause) Name() string + type SoftDeleteUpdateClause struct + Field *schema.Field + func (sd SoftDeleteUpdateClause) Build(clause.Builder) + func (sd SoftDeleteUpdateClause) MergeClause(*clause.Clause) + func (sd SoftDeleteUpdateClause) ModifyStatement(stmt *gorm.Statement) + func (sd SoftDeleteUpdateClause) Name() string type Store + AddMigrateList func(fs ...func() error) + AddShardingSuffixs func(suffixs string) (err error) + AddShardingTable func(table string) + SetShardingModel func(model int8, suffix []interface{}) + ShardingModel func() (model int8) + ShardingTable func() map[string][]string v1.0.0 Sep 16, 2023 Changes in this version + const TABLE_INIT_ALL + func IsUniqueError(err error) (ok bool) + type Condition struct + Columns string + Orders string + PageNumber int + PageSize int + QryDelete bool + TableName string + Where map[string]interface{} + func GenConditionWithParams(params reflect.Value) *Condition + func NewCondition() *Condition + type ModeListJson []interface + func (j *ModeListJson) Scan(value interface{}) error + func (j ModeListJson) Value() (driver.Value, error) + type ModeMapJson map[string]interface + func (j *ModeMapJson) Scan(value interface{}) error + func (j ModeMapJson) Value() (driver.Value, error) + type Model struct + CreatedAT uint + CreatedBy string + DeletedAT uint + DeletedBy string + ID uint + Status int8 + UpdatedAT uint + UpdatedBy string + func (m *Model) BeforeCreate(tx *gorm.DB) error + func (m *Model) BeforeDelete(tx *gorm.DB) error + func (m *Model) BeforeUpdate(tx *gorm.DB) error + type ModelQuery struct + ID uint + Status int8 + type RegisterFunc func() error + type Store interface + BuildQuery func(cb *Condition) (tx *gorm.DB) + BuildQueryWihtSubQryID func(cb *Condition) (tx *gorm.DB) + BuildQueryWithParams func(params reflect.Value) *gorm.DB + DB func() *gorm.DB + Name func() string + Register func(t Tabler, fs ...RegisterFunc) + SetConfig func(fs ...dsn.DsnFunc) error + Start func() error + Status func() int8 + Stop func() error + func New() (s Store) + type Tabler interface + TableName func() string