Versions in this module Expand all Collapse all v0 v0.19.4 Nov 1, 2026 Changes in this version + const CursorSeparator + const MaxFilterGroupDepth + const MaxTasksPerBatch + const MaxWorkers + const TimeFormat + var DefaultAsyncBatchWriterConfig = AsyncBatchWriterConfig + var ErrEmptyCursor = errors.New("empty cursor") + var ErrInvalidCursor = errors.New("invalid cursor format") + var ErrInvalidTimestamp = errors.New("invalid timestamp format") + func ApplyAndFilterGroup(db *gorm.DB, group *FilterGroup) *gorm.DB + func ApplyDesensitize(obj interface{}) + func ApplyDesensitizeSlice[T any](entities []*T) + func ApplyFieldSelection(db *gorm.DB, selectFields, omitFields, modelFields []string, autoFields bool) *gorm.DB + func ApplyFilter(dbQuery *gorm.DB, filter *Filter) *gorm.DB + func ApplyFilterGroup(db *gorm.DB, group *FilterGroup) *gorm.DB + func ApplyFilters(db *gorm.DB, filters []*Filter) *gorm.DB + func ApplyJoins(db *gorm.DB, query *Query, mainTable string) *gorm.DB + func ApplyOrFilterGroup(db *gorm.DB, group *FilterGroup) *gorm.DB + func ApplyOrdering(db *gorm.DB, orders []Order, defaultOrder string) *gorm.DB + func ApplyOrders(db *gorm.DB, orders []Order) *gorm.DB + func ApplyPaginationOrLimit(db *gorm.DB, query *Query) *gorm.DB + func ApplyPreloads(db *gorm.DB, preloads []string) *gorm.DB + func ApplyQueryConditions[T any](repo *BaseRepository[T], db *gorm.DB, query *Query, preloads ...string) *gorm.DB + func BuildSelectClause(tableName string, fields []string) string + func ConcurrentSimpleQuery[T any](e *ConcurrentQueryExecutor, ctx context.Context, ...) (map[string]T, bool) + func DeserializeJSON[T any](jsonStr string) (*T, error) + func DistinctInto[V any, T any](repo *BaseRepository[T], ctx context.Context, field string, filters ...*Filter) ([]V, error) + func FilterFields(allFields, selectFields, omitFields []string) []string + func GetDeleted[T any](ctx context.Context, db *gorm.DB, query *Query) ([]*T, error) + func GetDesensitizeFields(model interface{}) map[string]string + func GetNonDeleted[T any](ctx context.Context, db *gorm.DB, query *Query) ([]*T, error) + func GetNonPhysicalFields(model interface{}) []string + func GetSortableFields(model interface{}) []string + func GetStructFields(model interface{}) []string + func GetTodayRange() (startTime, endTime time.Time) + func IsTimeInTodayRange(t *time.Time, todayStart, todayEnd time.Time) bool + func IsToday(t *time.Time) bool + func IsTodayFromProto(t *timestamppb.Timestamp) bool + func IsTodayRange(startTime, endTime *time.Time) bool + func JsonArrayContainsDB(db *gorm.DB, column string, value interface{}) *gorm.DB + func JsonArrayContainsExpr(dialect Dialect, column string, value interface{}) (sql string, args []interface{}) + func JsonArrayContainsStr(dialect Dialect, column string, value interface{}) string + func JsonFieldEqualsExpr(dialect Dialect, column, jsonKey string, value interface{}) (sql string, args []interface{}) + func MustDeserializeJSON[T any](jsonStr string) *T + func MustSerializeJSON[T any](data *T) string + func PermanentlyDeleteBatch[T any](ctx context.Context, db *gorm.DB, ids []interface{}) error + func PermanentlyDelete[T any](ctx context.Context, db *gorm.DB, id interface{}) error + func PluckInto[V any, T any](repo *BaseRepository[T], ctx context.Context, field string, filters ...*Filter) ([]V, error) + func RegisterDesensitizeType(name string, desensitizer desensitize.Desensitizer) + func RestoreDeletedBatch[T any](ctx context.Context, db *gorm.DB, ids []interface{}) error + func RestoreDeleted[T any](ctx context.Context, db *gorm.DB, id interface{}) error + func SerializeJSON[T any](data *T) (string, error) + func StructHasField(model interface{}, field string) bool + type AggregateField struct + Alias string + Args []interface{} + Condition string + ElseValue interface{} + Function string + ThenValue string + type AggregateOperation struct + Alias string + Args []interface{} + Condition string + Distinct bool + Field string + Function string + type AsyncBatchWriter struct + func NewAsyncBatchWriter[T any](repo *BaseRepository[T], opts ...AsyncBatchWriterOption[T]) *AsyncBatchWriter[T] + func (w *AsyncBatchWriter[T]) Append(ctx context.Context, item *T) + func (w *AsyncBatchWriter[T]) Stop() + type AsyncBatchWriterConfig struct + BatchSize int + ChannelBuffer int + FlushInterval time.Duration + type AsyncBatchWriterOption func(*AsyncBatchWriter[T]) + func WithAsyncBatchConfig[T any](config AsyncBatchWriterConfig) AsyncBatchWriterOption[T] + func WithAsyncBatchLogger[T any](log logger.ILogger) AsyncBatchWriterOption[T] + type AuditModel struct + CreatedBy uint + UpdatedBy uint + func (m *AuditModel) GetCreatedBy() uint + func (m *AuditModel) GetUpdatedBy() uint + func (m *AuditModel) SetCreatedBy(userID uint) + func (m *AuditModel) SetUpdatedBy(userID uint) + type AuditableModel interface + GetCreatedBy func() uint + GetUpdatedBy func() uint + SetCreatedBy func(userID uint) + SetUpdatedBy func(userID uint) + type BaseModel struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + Remark string + Status int8 + UpdatedAt time.Time + Version int + func (m *BaseModel) BeforeUpdate(tx *gorm.DB) error + func (m *BaseModel) Disable() + func (m *BaseModel) Enable() + func (m *BaseModel) GetID() uint + func (m *BaseModel) GetVersion() int + func (m *BaseModel) IsDeleted() bool + func (m *BaseModel) IsEnabled() bool + func (m *BaseModel) IsNew() bool + func (m *BaseModel) SetCreatedAt(t time.Time) + func (m *BaseModel) SetRemark(remark string) + func (m *BaseModel) SetUpdatedAt(t time.Time) + type BaseRepository struct + func NewBaseRepository[T any](dbHandler db.Handler, logger logger.ILogger, table string, ...) *BaseRepository[T] + func (r *BaseRepository[T]) ApplyQueryFilters(db *gorm.DB, query *Query) *gorm.DB + func (r *BaseRepository[T]) ApplySort(q *Query, sort Sorter, defaultField, defaultDirection string, ...) *Query + func (r *BaseRepository[T]) BulkCreate(ctx context.Context, entities []*T, batchSize ...int) error + func (r *BaseRepository[T]) ConcurrentQuery(ctx context.Context, ...) (map[string]int64, bool) + func (r *BaseRepository[T]) Count(ctx context.Context, filters ...*Filter) (int64, error) + func (r *BaseRepository[T]) CountByField(ctx context.Context, field string) (map[interface{}]int64, error) + func (r *BaseRepository[T]) CountByFilterGroup(ctx context.Context, group *FilterGroup) (int64, error) + func (r *BaseRepository[T]) CountWhere(ctx context.Context, args ...interface{}) (int64, error) + func (r *BaseRepository[T]) CountWhereOp(ctx context.Context, args ...interface{}) (int64, error) + func (r *BaseRepository[T]) Create(ctx context.Context, entity *T) (*T, error) + func (r *BaseRepository[T]) CreateBatch(ctx context.Context, entities ...*T) error + func (r *BaseRepository[T]) CreateIfNotExists(ctx context.Context, entity *T, uniqueFields ...string) (*T, bool, error) + func (r *BaseRepository[T]) CreateOrUpdate(ctx context.Context, entity *T, uniqueFields ...string) (*T, bool, error) + func (r *BaseRepository[T]) DBHandler() db.Handler + func (r *BaseRepository[T]) Delete(ctx context.Context, id interface{}) error + func (r *BaseRepository[T]) DeleteBatch(ctx context.Context, ids ...interface{}) error + func (r *BaseRepository[T]) DeleteByFilterGroup(ctx context.Context, group *FilterGroup) error + func (r *BaseRepository[T]) DeleteByFilterGroupWithCount(ctx context.Context, group *FilterGroup) (int64, error) + func (r *BaseRepository[T]) DeleteByFilters(ctx context.Context, filters ...*Filter) error + func (r *BaseRepository[T]) DeleteByFiltersWithCount(ctx context.Context, filters ...*Filter) (int64, error) + func (r *BaseRepository[T]) DeleteByQuery(ctx context.Context, query *Query) error + func (r *BaseRepository[T]) DeleteWhere(ctx context.Context, args ...interface{}) error + func (r *BaseRepository[T]) DeleteWhereOp(ctx context.Context, args ...interface{}) error + func (r *BaseRepository[T]) DeleteWhereOpWithCount(ctx context.Context, args ...interface{}) (int64, error) + func (r *BaseRepository[T]) DisableAutoFields() + func (r *BaseRepository[T]) DisableDesensitize() + func (r *BaseRepository[T]) Distinct(ctx context.Context, field string, filters ...*Filter) ([]interface{}, error) + func (r *BaseRepository[T]) EnableAutoFields() + func (r *BaseRepository[T]) EnableDesensitize() + func (r *BaseRepository[T]) ExecuteConcurrentQueries(ctx context.Context, tasks []ConcurrentQueryTask[int64], ...) ([]ConcurrentQueryResult[int64], bool) + func (r *BaseRepository[T]) Exists(ctx context.Context, filters ...*Filter) (bool, error) + func (r *BaseRepository[T]) ExistsByField(ctx context.Context, field string, value interface{}, excludeField string, ...) (bool, error) + func (r *BaseRepository[T]) ExistsByFilterGroup(ctx context.Context, group *FilterGroup) (bool, error) + func (r *BaseRepository[T]) ExistsWhere(ctx context.Context, args ...interface{}) (bool, error) + func (r *BaseRepository[T]) Find(ctx context.Context, options *FindOptions) ([]*T, error) + func (r *BaseRepository[T]) FindOne(ctx context.Context, filters ...*Filter) (*T, error) + func (r *BaseRepository[T]) FindOneWhere(ctx context.Context, args ...interface{}) (*T, error) + func (r *BaseRepository[T]) FindOneWhereOp(ctx context.Context, args ...interface{}) (*T, error) + func (r *BaseRepository[T]) FindWhere(ctx context.Context, args ...interface{}) ([]*T, error) + func (r *BaseRepository[T]) FindWhereOp(ctx context.Context, args ...interface{}) ([]*T, error) + func (r *BaseRepository[T]) First(ctx context.Context, filters ...*Filter) (*T, error) + func (r *BaseRepository[T]) FirstWithQuery(ctx context.Context, query *Query) (*T, error) + func (r *BaseRepository[T]) Get(ctx context.Context, id interface{}) (*T, error) + func (r *BaseRepository[T]) GetAll(ctx context.Context) ([]*T, error) + func (r *BaseRepository[T]) GetByField(ctx context.Context, field string, value interface{}) (*T, error) + func (r *BaseRepository[T]) GetByFields(ctx context.Context, fields map[string]interface{}) (*T, error) + func (r *BaseRepository[T]) GetByFilter(ctx context.Context, filter *Filter) (*T, error) + func (r *BaseRepository[T]) GetByFilters(ctx context.Context, filters ...*Filter) (*T, error) + func (r *BaseRepository[T]) GetDialect() Dialect + func (r *BaseRepository[T]) GetModelFields() []string + func (r *BaseRepository[T]) GetNonPhysicalFields() []string + func (r *BaseRepository[T]) GetRandom(ctx context.Context, query *Query) (*T, error) + func (r *BaseRepository[T]) GetSortableFields() []string + func (r *BaseRepository[T]) GetWithPreloads(ctx context.Context, id interface{}, preloads ...string) (*T, error) + func (r *BaseRepository[T]) IsAutoFieldsEnabled() bool + func (r *BaseRepository[T]) IsDesensitizeEnabled() bool + func (r *BaseRepository[T]) JsonArrayCountComputedField(table, jsonColumn, valueColumn, alias string) ComputedField + func (r *BaseRepository[T]) Last(ctx context.Context, filters ...*Filter) (*T, error) + func (r *BaseRepository[T]) List(ctx context.Context, query *Query) ([]*T, error) + func (r *BaseRepository[T]) ListByIDs(ctx context.Context, ids interface{}) ([]*T, error) + func (r *BaseRepository[T]) ListWithPagination(ctx context.Context, query *Query, page ...*Pagination) ([]*T, *Pagination, error) + func (r *BaseRepository[T]) ListWithPagination32(ctx context.Context, query *Query, page ...*Pagination32) ([]*T, *Pagination32, error) + func (r *BaseRepository[T]) ListWithPagination64(ctx context.Context, query *Query, page ...*Pagination64) ([]*T, *Pagination64, error) + func (r *BaseRepository[T]) ListWithPreloads(ctx context.Context, query *Query, preloads ...string) ([]*T, error) + func (r *BaseRepository[T]) NewJsonArrayContainsFilter(column string, value interface{}) (string, []interface{}) + func (r *BaseRepository[T]) Paginate(ctx context.Context, page, pageSize int, args ...interface{}) ([]*T, *Pagination, error) + func (r *BaseRepository[T]) PaginateOp(ctx context.Context, page, pageSize int, args ...interface{}) ([]*T, *Pagination, error) + func (r *BaseRepository[T]) Pluck(ctx context.Context, field string, filters ...*Filter) ([]interface{}, error) + func (r *BaseRepository[T]) Restore(ctx context.Context, id interface{}, field string, restoreValue interface{}) error + func (r *BaseRepository[T]) RestoreBatch(ctx context.Context, ids []interface{}, field string, restoreValue interface{}) error + func (r *BaseRepository[T]) Save(ctx context.Context, entity *T) (*T, error) + func (r *BaseRepository[T]) SoftDelete(ctx context.Context, id interface{}, field string, value interface{}) error + func (r *BaseRepository[T]) SoftDeleteBatch(ctx context.Context, ids []interface{}, field string, value interface{}) error + func (r *BaseRepository[T]) SoftDeleteByFilters(ctx context.Context, field string, value interface{}, filters ...*Filter) error + func (r *BaseRepository[T]) Table() string + func (r *BaseRepository[T]) Transaction(ctx context.Context, fn func(tx Transaction[T]) error) error + func (r *BaseRepository[T]) TransactionWithRawDB(ctx context.Context, fn func(tx *gorm.DB) error) error + func (r *BaseRepository[T]) Update(ctx context.Context, entity *T) (*T, error) + func (r *BaseRepository[T]) UpdateBatch(ctx context.Context, entities ...*T) error + func (r *BaseRepository[T]) UpdateByFilters(ctx context.Context, entity *T, filters ...*Filter) error + func (r *BaseRepository[T]) UpdateFields(ctx context.Context, id interface{}, fields map[string]interface{}) error + func (r *BaseRepository[T]) UpdateFieldsByFilterGroup(ctx context.Context, fields map[string]interface{}, group *FilterGroup) error + func (r *BaseRepository[T]) UpdateFieldsByFilters(ctx context.Context, fields map[string]interface{}, filters ...*Filter) error + func (r *BaseRepository[T]) UpdateFieldsByFiltersWithVersion(ctx context.Context, fields map[string]interface{}, currentVersion int64, ...) (bool, error) + func (r *BaseRepository[T]) UpdateFieldsByQuery(ctx context.Context, fields map[string]interface{}, query *Query) error + func (r *BaseRepository[T]) UpdateFieldsWithOptimisticLock(ctx context.Context, id interface{}, currentVersion int64, ...) (bool, error) + func (r *BaseRepository[T]) UpdateWhere(ctx context.Context, updates map[string]interface{}, args ...interface{}) error + func (r *BaseRepository[T]) UpdateWhereOp(ctx context.Context, updates map[string]interface{}, args ...interface{}) error + type ClickHouseDialect struct + func (d *ClickHouseDialect) FormatTimeGroup(field string, groupType TimeGroupType) string + func (d *ClickHouseDialect) JsonArrayAppend(column, placeholder string) string + func (d *ClickHouseDialect) JsonArrayContains(column, placeholder string) string + func (d *ClickHouseDialect) JsonArrayCountSubQuery(table, jsonColumn, valueColumn string) string + func (d *ClickHouseDialect) JsonFieldExtract(column, jsonKey string) string + func (d *ClickHouseDialect) RandomOrderExpr() string + func (d *ClickHouseDialect) UpsertColumnRef(column string) string + type CockroachDBDialect struct + func (d *CockroachDBDialect) FormatTimeGroup(field string, groupType TimeGroupType) string + func (d *CockroachDBDialect) JsonArrayAppend(column, placeholder string) string + func (d *CockroachDBDialect) JsonArrayContains(column, placeholder string) string + func (d *CockroachDBDialect) JsonArrayCountSubQuery(table, jsonColumn, valueColumn string) string + func (d *CockroachDBDialect) JsonFieldExtract(column, jsonKey string) string + func (d *CockroachDBDialect) RandomOrderExpr() string + func (d *CockroachDBDialect) UpsertColumnRef(column string) string + type ComparedColumn struct + ColumnName string + DBFieldName string + TableAlias string + type ComparedValue struct + IsRaw bool + Value interface{} + type ComputedField struct + Alias string + Expr string + func JsonArrayCountComputedField(dialect Dialect, table, jsonColumn, valueColumn, alias string) ComputedField + type ConcurrentQueryBuilder struct + func NewConcurrentQueryBuilder(db *gorm.DB, tableName, selectSQL string) *ConcurrentQueryBuilder + func (b *ConcurrentQueryBuilder) Build() func(ctx context.Context) (int64, error) + func (b *ConcurrentQueryBuilder) BuildWithTimeRange(startTime, endTime time.Time) func(ctx context.Context) (int64, error) + func (b *ConcurrentQueryBuilder) Where(condition string, args ...interface{}) *ConcurrentQueryBuilder + type ConcurrentQueryExecutor struct + func NewConcurrentQueryExecutor(db *gorm.DB) *ConcurrentQueryExecutor + func (e *ConcurrentQueryExecutor) WithLogger(log logger.ILogger) *ConcurrentQueryExecutor + func (e *ConcurrentQueryExecutor) WithTimeout(timeout time.Duration) *ConcurrentQueryExecutor + func (e *ConcurrentQueryExecutor) WithWorkers(workers int) *ConcurrentQueryExecutor + type ConcurrentQueryOption func(*ConcurrentQueryExecutor) + func WithQueryTimeout(timeout time.Duration) ConcurrentQueryOption + func WithQueryWorkers(workers int) ConcurrentQueryOption + type ConcurrentQueryResult struct + Error error + Name string + Value T + func ExecuteConcurrentQueries[T any](ctx context.Context, db *gorm.DB, log logger.ILogger, ...) ([]ConcurrentQueryResult[T], bool) + func ExecuteConcurrentQuery[T any](e *ConcurrentQueryExecutor, ctx context.Context, ...) ([]ConcurrentQueryResult[T], bool) + type ConcurrentQueryTask struct + Name string + OnError func(error) + OnSuccess func(T) + Query func(ctx context.Context) (T, error) + type Condition struct + Field string + Op constants.Operator + Value interface{} + type ConditionalAggregateBuilder struct + func NewConditionalAggregateBuilder(db *gorm.DB, tableName string) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) AvgWhen(condition, field string, alias string, args ...interface{}) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) Build() (*gorm.DB, []interface{}) + func (b *ConditionalAggregateBuilder) CountWhen(condition string, alias string, args ...interface{}) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) Execute(ctx context.Context) (map[string]interface{}, error) + func (b *ConditionalAggregateBuilder) ExecuteInto(ctx context.Context, dest interface{}) error + func (b *ConditionalAggregateBuilder) ExecuteList(ctx context.Context) ([]map[string]interface{}, error) + func (b *ConditionalAggregateBuilder) GroupBy(fields ...string) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) Having(condition string, args ...interface{}) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) Limit(limit int) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) MaxWhen(condition, field string, alias string, args ...interface{}) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) MinWhen(condition, field string, alias string, args ...interface{}) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) OrderBy(order string) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) SumWhen(condition string, alias string, args ...interface{}) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) WithTimeField(field string) *ConditionalAggregateBuilder + func (b *ConditionalAggregateBuilder) WithTimeRange(start, end time.Time) *ConditionalAggregateBuilder + type ContextFieldExtractor func(ctx context.Context, log logger.ILogger) logger.ILogger + type Dialect interface + FormatTimeGroup func(field string, groupType TimeGroupType) string + JsonArrayAppend func(column, placeholder string) string + JsonArrayContains func(column, placeholder string) string + JsonArrayCountSubQuery func(table, jsonColumn, valueColumn string) string + JsonFieldExtract func(column, jsonKey string) string + RandomOrderExpr func() string + UpsertColumnRef func(column string) string + func DetectDialect(db *gorm.DB) Dialect + type EnhancedRepository struct + func NewEnhancedRepositoryWithDB[T any](gormDB *gorm.DB, logger gologger.ILogger, tableName string) *EnhancedRepository[T] + func NewEnhancedRepository[T any](dbHandler db.Handler, logger gologger.ILogger, tableName string) *EnhancedRepository[T] + func (r *EnhancedRepository[T]) BatchUpdateByField(ctx context.Context, field string, values []interface{}, ...) error + func (r *EnhancedRepository[T]) CountByField(ctx context.Context, field string, value interface{}) (int64, error) + func (r *EnhancedRepository[T]) CreateIfNotExists(ctx context.Context, entity *T, checkField string) (*T, bool, error) + func (r *EnhancedRepository[T]) DecrementField(ctx context.Context, whereField string, whereValue interface{}, ...) error + func (r *EnhancedRepository[T]) DeleteByField(ctx context.Context, field string, value interface{}) error + func (r *EnhancedRepository[T]) ExistsBy(ctx context.Context, field string, value interface{}) (bool, error) + func (r *EnhancedRepository[T]) FindByField(ctx context.Context, field string, value interface{}) ([]*T, error) + func (r *EnhancedRepository[T]) FindByFieldWithCursor(ctx context.Context, field string, value interface{}, cursorField string, ...) ([]*T, bool, error) + func (r *EnhancedRepository[T]) FindByFieldWithPagination(ctx context.Context, field string, value interface{}, limit, offset int) ([]*T, int64, error) + func (r *EnhancedRepository[T]) FindByFields(ctx context.Context, conditions map[string]interface{}) ([]*T, error) + func (r *EnhancedRepository[T]) FindByTimeRange(ctx context.Context, timeField string, startTime, endTime interface{}) ([]*T, error) + func (r *EnhancedRepository[T]) FindInField(ctx context.Context, field string, values []interface{}) ([]*T, error) + func (r *EnhancedRepository[T]) FindOneByField(ctx context.Context, field string, value interface{}) (*T, error) + func (r *EnhancedRepository[T]) FindWithOrder(ctx context.Context, whereField string, whereValue interface{}, ...) ([]*T, error) + func (r *EnhancedRepository[T]) GetDistinctValues(ctx context.Context, field string) ([]interface{}, error) + func (r *EnhancedRepository[T]) IncrementField(ctx context.Context, whereField string, whereValue interface{}, ...) error + func (r *EnhancedRepository[T]) UpdateByField(ctx context.Context, field string, value interface{}, ...) error + func (r *EnhancedRepository[T]) UpdateSingleField(ctx context.Context, whereField string, whereValue interface{}, ...) error + type Filter struct + Field string + Operator constants.Operator + Value interface{} + func NewBetweenFilter(field string, min, max interface{}) *Filter + func NewContainsFilter(field string, value string) *Filter + func NewEndsWithFilter(field string, value string) *Filter + func NewEqFilter(field string, value interface{}) *Filter + func NewFilter(field string, operator constants.Operator, value interface{}) *Filter + func NewFindInSetFilter(field string, value interface{}) *Filter + func NewGtFilter(field string, value interface{}) *Filter + func NewGteFilter(field string, value interface{}) *Filter + func NewILikeFilter(field string, value string) *Filter + func NewInFilter(field string, values ...interface{}) *Filter + func NewInFilterSlice(field string, values []interface{}) *Filter + func NewInSubQueryFilter(field, subSQL string, args ...interface{}) *Filter + func NewIsNotNullFilter(field string) *Filter + func NewIsNullFilter(field string) *Filter + func NewJsonArrayContainsFilter(field string, value interface{}) *Filter + func NewJsonFieldEqFilter(column, jsonKey string, value interface{}) *Filter + func NewJsonbLikeFilter(field string, value string) *Filter + func NewLikeFilter(field string, value string) *Filter + func NewLtFilter(field string, value interface{}) *Filter + func NewLteFilter(field string, value interface{}) *Filter + func NewNeqFilter(field string, value interface{}) *Filter + func NewNotBetweenFilter(field string, min, max interface{}) *Filter + func NewNotILikeFilter(field string, value string) *Filter + func NewNotInFilter(field string, values ...interface{}) *Filter + func NewNotInFilterSlice(field string, values []interface{}) *Filter + func NewNotInSubQueryFilter(field, subSQL string, args ...interface{}) *Filter + func NewNotLikeFilter(field string, value string) *Filter + func NewRegexpFilter(field string, pattern string) *Filter + func NewStartsWithFilter(field string, value string) *Filter + type FilterGroup struct + Filters []*Filter + Groups []*FilterGroup + LogicOp constants.Operator + func FilterGroupByModel(group *FilterGroup, model interface{}) *FilterGroup + func NewFilterGroup(logicOp constants.Operator) *FilterGroup + func NewKeywordFilterGroup(keyword string, likeFields, iLikeFields []string) *FilterGroup + func (fg *FilterGroup) AddBetweenFilterIfNotEmpty(field string, min, max interface{}) *FilterGroup + func (fg *FilterGroup) AddEndsWithFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddEqFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddFilter(filter *Filter) *FilterGroup + func (fg *FilterGroup) AddFilterIf(condition bool, filter *Filter) *FilterGroup + func (fg *FilterGroup) AddFilterIfNotEmpty(field string, operator constants.Operator, value interface{}) *FilterGroup + func (fg *FilterGroup) AddFilterIfValueNotEmpty(filter *Filter) *FilterGroup + func (fg *FilterGroup) AddFilters(filters ...*Filter) *FilterGroup + func (fg *FilterGroup) AddFindInSetFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddGroup(group *FilterGroup) *FilterGroup + func (fg *FilterGroup) AddGroupIf(condition bool, group *FilterGroup) *FilterGroup + func (fg *FilterGroup) AddGroupIfNotEmpty(group *FilterGroup) *FilterGroup + func (fg *FilterGroup) AddGtFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddGteFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddILikeFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddInFilterIfNotEmpty(field string, values interface{}) *FilterGroup + func (fg *FilterGroup) AddJsonArrayContainsFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddJsonFieldEqFilterIfNotEmpty(column, jsonKey string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddLikeFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddLtFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddLteFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddNeqFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddNotILikeFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddNotInFilterIfNotEmpty(field string, values interface{}) *FilterGroup + func (fg *FilterGroup) AddNotLikeFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) AddRegexpFilterIfNotEmpty(field string, pattern interface{}) *FilterGroup + func (fg *FilterGroup) AddStartsWithFilterIfNotEmpty(field string, value interface{}) *FilterGroup + func (fg *FilterGroup) Clear() *FilterGroup + func (fg *FilterGroup) Clone() *FilterGroup + func (fg *FilterGroup) Count() int + func (fg *FilterGroup) IsEmpty() bool + type FindOptions struct + Conditions []Condition + Limit int + Offset int + Orders []OrderBy + type FullFeaturedModel interface + type JoinField struct + Alias string + Expr string + type JoinSpec struct + Alias string + Args []interface{} + JoinType string + On string + SelectFields []JoinField + Table string + type LightModel struct + CreatedAt time.Time + ID uint + Status int8 + UpdatedAt time.Time + func (m *LightModel) Disable() + func (m *LightModel) Enable() + func (m *LightModel) GetID() uint + func (m *LightModel) IsEnabled() bool + func (m *LightModel) IsNew() bool + type ModelInterface interface + IsNew func() bool + type MultiTableStatsBuilder struct + func NewMultiTableStatsBuilder(ctx context.Context, db *gorm.DB, log logger.ILogger) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) AddCondition(tableName, condition string, args ...interface{}) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) Avg(tableName, field, alias string) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) Count(tableName, alias string) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) CountDistinct(tableName, field, alias string) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) Execute() (map[string]int64, error) + func (b *MultiTableStatsBuilder) ExecuteWithDetails() ([]ConcurrentQueryResult[int64], bool, error) + func (b *MultiTableStatsBuilder) Max(tableName, field, alias string) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) Min(tableName, field, alias string) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) Sum(tableName, field, alias string) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) WithTimeField(field string) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) WithTimeRange(start, end time.Time) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) WithTimeout(timeout time.Duration) *MultiTableStatsBuilder + func (b *MultiTableStatsBuilder) WithWorkers(workers int) *MultiTableStatsBuilder + type MySQLDialect struct + func (d *MySQLDialect) FormatTimeGroup(field string, groupType TimeGroupType) string + func (d *MySQLDialect) JsonArrayAppend(column, placeholder string) string + func (d *MySQLDialect) JsonArrayContains(column, placeholder string) string + func (d *MySQLDialect) JsonArrayCountSubQuery(table, jsonColumn, valueColumn string) string + func (d *MySQLDialect) JsonFieldExtract(column, jsonKey string) string + func (d *MySQLDialect) RandomOrderExpr() string + func (d *MySQLDialect) UpsertColumnRef(column string) string + type NormalizeFunc func(value string) string + type Order struct + Direction string + Field string + type OrderBy struct + Direction string + Field string + type Pagination = PaginationT[int] + type Pagination32 = PaginationT[int32] + type Pagination64 = PaginationT[int64] + type PaginationResult32 = Pagination32 + type PaginationResult64 = Pagination64 + type PaginationT struct + Page T + PageSize T + Total int64 + func ListWithPaginationT[T any, P types.Integer](r *BaseRepository[T], ctx context.Context, query *Query, ...) ([]*T, *PaginationT[P], error) + func (p *PaginationT[T]) GetLimit() int + func (p *PaginationT[T]) GetOffset() int + func (p *PaginationT[T]) GetTotalPages() T + func (p *PaginationT[T]) HasNextPage() bool + func (p *PaginationT[T]) HasPrevPage() bool + func (p *PaginationT[T]) ToInt() *Pagination + func (p *PaginationT[T]) ToInt32() *Pagination32 + func (p *PaginationT[T]) ToInt64() *Pagination64 + type PostgreSQLDialect struct + func (d *PostgreSQLDialect) FormatTimeGroup(field string, groupType TimeGroupType) string + func (d *PostgreSQLDialect) JsonArrayAppend(column, placeholder string) string + func (d *PostgreSQLDialect) JsonArrayContains(column, placeholder string) string + func (d *PostgreSQLDialect) JsonArrayCountSubQuery(table, jsonColumn, valueColumn string) string + func (d *PostgreSQLDialect) JsonFieldExtract(column, jsonKey string) string + func (d *PostgreSQLDialect) RandomOrderExpr() string + func (d *PostgreSQLDialect) UpsertColumnRef(column string) string + type Query struct + ComputedFields []ComputedField + Desensitize bool + Distinct bool + FilterGroup *FilterGroup + Filters []*Filter + GroupBy []string + Having []*Filter + JoinExtract interface{} + JoinScanDest interface{} + Joins []JoinSpec + LimitValue *int + OffsetValue *int + OmitFields []string + Orders []Order + Pagination *Pagination + SelectFields []string + func NewQuery() *Query + func (q *Query) AddBetween(field string, start, end interface{}) *Query + func (q *Query) AddBetweenFilterIfNotEmpty(field string, min, max interface{}) *Query + func (q *Query) AddComputedField(expr, alias string) *Query + func (q *Query) AddComputedFields(fields ...ComputedField) *Query + func (q *Query) AddCursorFilter(field string, cursor interface{}, isPrev bool) *Query + func (q *Query) AddEndsWith(field, suffix string) *Query + func (q *Query) AddEndsWithFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddEqOrInFilter(field string, values interface{}) *Query + func (q *Query) AddEqual(field string, value interface{}) *Query + func (q *Query) AddFilter(filter *Filter) *Query + func (q *Query) AddFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddFilters(filters ...*Filter) *Query + func (q *Query) AddFindInSetFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddGreaterEqual(field string, value interface{}) *Query + func (q *Query) AddGreaterThan(field string, value interface{}) *Query + func (q *Query) AddGroupBy(fields ...string) *Query + func (q *Query) AddGtFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddGteFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddHaving(filter *Filter) *Query + func (q *Query) AddILikeFilterIfNotEmpty(field string, keyword interface{}) *Query + func (q *Query) AddIn(field string, values ...interface{}) *Query + func (q *Query) AddInFilterIfNotEmpty(field string, values interface{}) *Query + func (q *Query) AddInSubQueryFilterIfNotEmpty(field, subSQL string, args ...interface{}) *Query + func (q *Query) AddIsNotNull(field string) *Query + func (q *Query) AddIsNull(field string) *Query + func (q *Query) AddJoin(joinType, table, alias, on string, args ...interface{}) *Query + func (q *Query) AddJoinWithSelect(joinType, table, alias, on string, selectFields []JoinField, ...) *Query + func (q *Query) AddJsonArrayContainsFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddJsonbLikeFilterIfNotEmpty(field string, keyword interface{}) *Query + func (q *Query) AddLessEqual(field string, value interface{}) *Query + func (q *Query) AddLessThan(field string, value interface{}) *Query + func (q *Query) AddLike(field, keyword string) *Query + func (q *Query) AddLikeFilterIfNotEmpty(field string, keyword interface{}) *Query + func (q *Query) AddLtFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddLteFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddNeqFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddNotEqual(field string, value interface{}) *Query + func (q *Query) AddNotILikeFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddNotIn(field string, values ...interface{}) *Query + func (q *Query) AddNotInFilterIfNotEmpty(field string, values interface{}) *Query + func (q *Query) AddNotInSubQueryFilterIfNotEmpty(field, subSQL string, args ...interface{}) *Query + func (q *Query) AddNotLikeFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddOrder(field, direction string) *Query + func (q *Query) AddOrderAsc(field string) *Query + func (q *Query) AddOrderDesc(field string) *Query + func (q *Query) AddRawFilter(rawCondition string) *Query + func (q *Query) AddRawOrder(orderExpr string) *Query + func (q *Query) AddSafeOrder(sortBy, sortOrder, defaultField, defaultDirection string, ...) *Query + func (q *Query) AddSafeOrderBool(sortBy string, ascending bool, defaultField, defaultDirection string, ...) *Query + func (q *Query) AddSafeOrderFromSort(sort Sorter, defaultField, defaultDirection string, allowedFields ...[]string) *Query + func (q *Query) AddStartsWith(field, prefix string) *Query + func (q *Query) AddStartsWithFilterIfNotEmpty(field string, value interface{}) *Query + func (q *Query) AddThisMonth(field string) *Query + func (q *Query) AddThisWeek(field string) *Query + func (q *Query) AddThisYear(field string) *Query + func (q *Query) AddTimeAfter(field string, t time.Time) *Query + func (q *Query) AddTimeBefore(field string, t time.Time) *Query + func (q *Query) AddTimeBetween(field string, start, end time.Time) *Query + func (q *Query) AddTimeRangeFilter(field string, startTime, endTime interface{}) *Query + func (q *Query) AddToday(field string) *Query + func (q *Query) BuildWhereClause() (string, []interface{}) + func (q *Query) Clone() *Query + func (q *Query) GetAllFilters() []*Filter + func (q *Query) GetPagination() *Pagination + func (q *Query) HasFilters() bool + func (q *Query) HasGroupBy() bool + func (q *Query) HasHaving() bool + func (q *Query) HasOmitFields() bool + func (q *Query) HasOrders() bool + func (q *Query) HasPagination() bool + func (q *Query) HasSelectFields() bool + func (q *Query) IsLimited() bool + func (q *Query) IsOffset() bool + func (q *Query) Limit(limit int) *Query + func (q *Query) Offset(offset int) *Query + func (q *Query) Omit(fields ...string) *Query + func (q *Query) OmitLargeFields() *Query + func (q *Query) OmitSensitive() *Query + func (q *Query) ResetFilters() *Query + func (q *Query) ResetOrders() *Query + func (q *Query) ResetPagination() *Query + func (q *Query) Select(fields ...string) *Query + func (q *Query) SetDialect(dialect Dialect) + func (q *Query) SetPage(page interface{}) *Query + func (q *Query) SetPageSize(pageSize interface{}) *Query + func (q *Query) SetPagination(page, pageSize interface{}) *Query + func (q *Query) WithDesensitize() *Query + func (q *Query) WithDistinct() *Query + func (q *Query) WithFilterGroup(group *FilterGroup) *Query + func (q *Query) WithFilters(builders ...QueryFilterBuilder) *Query + func (q *Query) WithJoinScan(scanDest interface{}, extract interface{}) *Query + func (q *Query) WithKeywordFilter(keyword string, likeFields, iLikeFields []string) *Query + func (q *Query) WithPaging(page, pageSize interface{}) *Query + func (q *Query) WithScope(hook ScopeHook) *Query + func (q *Query) WithScopeFilters(hook ScopeHook, builders ...QueryFilterBuilder) *Query + type QueryCondition struct + Filters []Filter + Orders []OrderBy + Pagination *Pagination + type QueryFilterBuilder func(query *Query) + type RemarkableModel interface + SetRemark func(remark string) + type Repository interface + ConcurrentQuery func(ctx context.Context, ...) (map[string]int64, bool) + Count func(ctx context.Context, filters ...*Filter) (int64, error) + CountByField func(ctx context.Context, field string) (map[interface{}]int64, error) + Create func(ctx context.Context, entity *T) (*T, error) + CreateBatch func(ctx context.Context, entities ...*T) error + Delete func(ctx context.Context, id interface{}) error + DeleteBatch func(ctx context.Context, ids ...interface{}) error + DeleteByFilters func(ctx context.Context, filters ...*Filter) error + DeleteByQuery func(ctx context.Context, query *Query) error + Distinct func(ctx context.Context, field string, filters ...*Filter) ([]interface{}, error) + ExecuteConcurrentQueries func(ctx context.Context, tasks []ConcurrentQueryTask[int64], ...) ([]ConcurrentQueryResult[int64], bool) + Exists func(ctx context.Context, filters ...*Filter) (bool, error) + FindOne func(ctx context.Context, filters ...*Filter) (*T, error) + First func(ctx context.Context, filters ...*Filter) (*T, error) + FirstWithQuery func(ctx context.Context, query *Query) (*T, error) + Get func(ctx context.Context, id interface{}) (*T, error) + GetAll func(ctx context.Context) ([]*T, error) + GetByFilter func(ctx context.Context, filter *Filter) (*T, error) + GetByFilters func(ctx context.Context, filters ...*Filter) (*T, error) + Last func(ctx context.Context, filters ...*Filter) (*T, error) + List func(ctx context.Context, query *Query) ([]*T, error) + ListWithPagination func(ctx context.Context, query *Query, page ...*Pagination) ([]*T, *Pagination, error) + Pluck func(ctx context.Context, field string, filters ...*Filter) ([]interface{}, error) + Restore func(ctx context.Context, id interface{}, field string, restoreValue interface{}) error + RestoreBatch func(ctx context.Context, ids []interface{}, field string, restoreValue interface{}) error + SoftDelete func(ctx context.Context, id interface{}, field string, value interface{}) error + SoftDeleteBatch func(ctx context.Context, ids []interface{}, field string, value interface{}) error + SoftDeleteByFilters func(ctx context.Context, field string, value interface{}, filters ...*Filter) error + Transaction func(ctx context.Context, fn func(tx Transaction[T]) error) error + TransactionWithRawDB func(ctx context.Context, fn func(tx *gorm.DB) error) error + Update func(ctx context.Context, entity *T) (*T, error) + UpdateBatch func(ctx context.Context, entities ...*T) error + UpdateByFilters func(ctx context.Context, entity *T, filters ...*Filter) error + UpdateFields func(ctx context.Context, id interface{}, fields map[string]interface{}) error + UpdateFieldsByFilters func(ctx context.Context, fields map[string]interface{}, filters ...*Filter) error + UpdateFieldsByQuery func(ctx context.Context, fields map[string]interface{}, query *Query) error + type RepositoryFactory interface + Close func() error + CreateRepository func(table string) Repository[T] + type RepositoryOption func(*BaseRepository[T]) + func WithAutoFields[T any]() RepositoryOption[T] + func WithBatchSize[T any](size int) RepositoryOption[T] + func WithDefaultOrder[T any](order string) RepositoryOption[T] + func WithDefaultPreloads[T any](preloads ...string) RepositoryOption[T] + func WithDesensitize[T any]() RepositoryOption[T] + func WithLogger[T any](log logger.ILogger) RepositoryOption[T] + func WithNormalizeConfig[T any](enabled bool, fn NormalizeFunc, defaultValue string) RepositoryOption[T] + func WithNormalizeDefaultValue[T any](defaultValue string) RepositoryOption[T] + func WithNormalizeFunc[T any](fn NormalizeFunc) RepositoryOption[T] + func WithNormalize[T any]() RepositoryOption[T] + func WithReadOnly[T any]() RepositoryOption[T] + func WithTimeout[T any](seconds int) RepositoryOption[T] + type RepositoryWithSoftDelete struct + func NewRepositoryWithSoftDelete[T any](repo *BaseRepository[T]) *RepositoryWithSoftDelete[T] + func (r *RepositoryWithSoftDelete[T]) ListDeleted(ctx context.Context, query *Query) ([]*T, error) + func (r *RepositoryWithSoftDelete[T]) ListDeletedByIsDeleted(ctx context.Context, query *Query) ([]*T, error) + func (r *RepositoryWithSoftDelete[T]) ListNotDeleted(ctx context.Context, query *Query) ([]*T, error) + func (r *RepositoryWithSoftDelete[T]) ListNotDeletedByIsDeleted(ctx context.Context, query *Query) ([]*T, error) + func (r *RepositoryWithSoftDelete[T]) RestoreBatchWithDeletedAt(ctx context.Context, ids []interface{}) error + func (r *RepositoryWithSoftDelete[T]) RestoreBatchWithIsDeleted(ctx context.Context, ids []interface{}) error + func (r *RepositoryWithSoftDelete[T]) RestoreWithDeletedAt(ctx context.Context, id interface{}) error + func (r *RepositoryWithSoftDelete[T]) RestoreWithIsDeleted(ctx context.Context, id interface{}) error + func (r *RepositoryWithSoftDelete[T]) SoftDeleteBatchWithDeletedAt(ctx context.Context, ids []interface{}) error + func (r *RepositoryWithSoftDelete[T]) SoftDeleteBatchWithIsDeleted(ctx context.Context, ids []interface{}) error + func (r *RepositoryWithSoftDelete[T]) SoftDeleteByFiltersWithDeletedAt(ctx context.Context, filters ...*Filter) error + func (r *RepositoryWithSoftDelete[T]) SoftDeleteByFiltersWithIsDeleted(ctx context.Context, filters ...*Filter) error + func (r *RepositoryWithSoftDelete[T]) SoftDeleteWithDeletedAt(ctx context.Context, id interface{}) error + func (r *RepositoryWithSoftDelete[T]) SoftDeleteWithIsDeleted(ctx context.Context, id interface{}) error + type SQLiteDialect struct + func (d *SQLiteDialect) FormatTimeGroup(field string, groupType TimeGroupType) string + func (d *SQLiteDialect) JsonArrayAppend(column, placeholder string) string + func (d *SQLiteDialect) JsonArrayContains(column, placeholder string) string + func (d *SQLiteDialect) JsonArrayCountSubQuery(table, jsonColumn, valueColumn string) string + func (d *SQLiteDialect) JsonFieldExtract(column, jsonKey string) string + func (d *SQLiteDialect) RandomOrderExpr() string + func (d *SQLiteDialect) UpsertColumnRef(column string) string + type ScopeHook interface + ApplyScope func(query *Query) *Query + type SimpleModel struct + CreatedAt time.Time + ID uint + UpdatedAt time.Time + func (m *SimpleModel) GetID() uint + func (m *SimpleModel) IsNew() bool + type SoftDeletableModel interface + IsDeleted func() bool + type SoftDeleteHelper interface + RestoreBatchWithDeletedAt func(ctx context.Context, ids []interface{}) error + RestoreBatchWithIsDeleted func(ctx context.Context, ids []interface{}) error + RestoreWithDeletedAt func(ctx context.Context, id interface{}) error + RestoreWithIsDeleted func(ctx context.Context, id interface{}) error + SoftDeleteBatchWithDeletedAt func(ctx context.Context, ids []interface{}) error + SoftDeleteBatchWithIsDeleted func(ctx context.Context, ids []interface{}) error + SoftDeleteByFiltersWithDeletedAt func(ctx context.Context, filters ...*Filter) error + SoftDeleteByFiltersWithIsDeleted func(ctx context.Context, filters ...*Filter) error + SoftDeleteWithDeletedAt func(ctx context.Context, id interface{}) error + SoftDeleteWithIsDeleted func(ctx context.Context, id interface{}) error + type Sorter interface + GetAscending func() bool + GetField func() string + type StatusModel interface + Disable func() + Enable func() + IsEnabled func() bool + type SubQuery struct + Args []interface{} + SQL string + func NewSubQuery(sql string, args ...interface{}) *SubQuery + type TimeEntityCursor struct + EntityID string + Timestamp string + func NewTimeEntityCursor(timestamp *time.Time, entityID string) *TimeEntityCursor + func NewTimeEntityCursorFromTime(t time.Time, entityID string, format ...string) *TimeEntityCursor + func ParseTimeEntityCursor(cursorStr string) *TimeEntityCursor + func ParseTimeEntityCursorFromJSON(jsonStr string) (*TimeEntityCursor, error) + func (c *TimeEntityCursor) Clone() *TimeEntityCursor + func (c *TimeEntityCursor) Compare(other *TimeEntityCursor) (int, error) + func (c *TimeEntityCursor) Equal(other *TimeEntityCursor) bool + func (c *TimeEntityCursor) GetTime() (*time.Time, error) + func (c *TimeEntityCursor) IsEmpty() bool + func (c *TimeEntityCursor) IsValid() error + func (c *TimeEntityCursor) String() string + func (c *TimeEntityCursor) ToBase64() string + func (c *TimeEntityCursor) ToJSON() (string, error) + type TimeEntityCursorBuilder struct + func NewCursorBuilder() *TimeEntityCursorBuilder + func (b *TimeEntityCursorBuilder) Build() (*TimeEntityCursor, error) + func (b *TimeEntityCursorBuilder) MustBuild() *TimeEntityCursor + func (b *TimeEntityCursorBuilder) WithEntityID(entityID string) *TimeEntityCursorBuilder + func (b *TimeEntityCursorBuilder) WithTime(t *time.Time) *TimeEntityCursorBuilder + func (b *TimeEntityCursorBuilder) WithTimestamp(timestamp string) *TimeEntityCursorBuilder + type TimeGroupBuilder struct + func NewTimeGroupBuilder(db *gorm.DB, tableName string, groupType TimeGroupType) *TimeGroupBuilder + func (b *TimeGroupBuilder) AddGroupBy(fields ...string) *TimeGroupBuilder + func (b *TimeGroupBuilder) Avg(field, alias string) *TimeGroupBuilder + func (b *TimeGroupBuilder) Build() (*gorm.DB, []interface{}) + func (b *TimeGroupBuilder) Count(alias string) *TimeGroupBuilder + func (b *TimeGroupBuilder) CountDistinct(field, alias string) *TimeGroupBuilder + func (b *TimeGroupBuilder) CountWhen(condition, alias string, args ...interface{}) *TimeGroupBuilder + func (b *TimeGroupBuilder) Execute(ctx context.Context) ([]map[string]interface{}, error) + func (b *TimeGroupBuilder) ExecuteInto(ctx context.Context, dest interface{}) error + func (b *TimeGroupBuilder) Having(condition string, args ...interface{}) *TimeGroupBuilder + func (b *TimeGroupBuilder) Limit(limit int) *TimeGroupBuilder + func (b *TimeGroupBuilder) Max(field, alias string) *TimeGroupBuilder + func (b *TimeGroupBuilder) Min(field, alias string) *TimeGroupBuilder + func (b *TimeGroupBuilder) OrderBy(order string) *TimeGroupBuilder + func (b *TimeGroupBuilder) Sum(field, alias string) *TimeGroupBuilder + func (b *TimeGroupBuilder) SumWhen(condition, alias string, args ...interface{}) *TimeGroupBuilder + func (b *TimeGroupBuilder) Where(condition string, args ...interface{}) *TimeGroupBuilder + func (b *TimeGroupBuilder) WithTimeField(field string) *TimeGroupBuilder + func (b *TimeGroupBuilder) WithTimeRange(start, end time.Time) *TimeGroupBuilder + type TimeGroupType string + const GroupByDay + const GroupByHour + const GroupByMonth + const GroupByWeek + const GroupByYear + type TimestampModel struct + CreatedAt time.Time + UpdatedAt time.Time + type Transaction interface + Create func(ctx context.Context, entity *T) error + CreateBatch func(ctx context.Context, entities ...*T) error + Delete func(ctx context.Context, entity *T) error + DeleteBatch func(ctx context.Context, entities ...*T) error + Update func(ctx context.Context, entity *T) error + UpdateBatch func(ctx context.Context, entities ...*T) error + type UUIDModel struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID string + UpdatedAt time.Time + Version int + func (m *UUIDModel) BeforeUpdate(tx *gorm.DB) error + func (m *UUIDModel) GetID() string + func (m *UUIDModel) GetVersion() int + func (m *UUIDModel) IsDeleted() bool + func (m *UUIDModel) IsNew() bool + type VersionedModel interface + GetVersion func() int