Documentation ¶
Index ¶
- Constants
- type BaseOption
- type BaseOptionFunc
- func WithBatchSize(v int64) BaseOptionFunc
- func WithConds(vs ...any) BaseOptionFunc
- func WithIgnore(v bool) BaseOptionFunc
- func WithLock(v bool) BaseOptionFunc
- func WithOmits(vs ...string) BaseOptionFunc
- func WithPage(v IPage) BaseOptionFunc
- func WithReadOnly(v bool) BaseOptionFunc
- func WithSelects(vs ...string) BaseOptionFunc
- type DbAction
- type IBizRequest
- type IEntity
- type IPage
- type IPaginator
- type IPo
- type IRange
- type IRepository
- type ISortField
- type IUnitOfWork
Constants ¶
View Source
const (
BATCH_SIZE = 1000 // default batch size
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseOption ¶
type BaseOption struct { Ignore bool `json:"ignore"` // ignore if exist Lock bool `json:"lock"` // lock row ReadOnly bool `json:"readOnly"` // read only Selects []string `json:"selects"` // select fields Omits []string `json:"omits"` // omit fields select omit Conds []any `json:"conds"` // conds where Page IPage `json:"page"` // page BatchSize int64 `json:"batchSize"` // exec by batch }
BaseOption base repo exec
func NewBaseOption ¶ added in v0.0.7
func NewBaseOption(opts ...BaseOptionFunc) *BaseOption
NewBaseOption with func
type BaseOptionFunc ¶ added in v0.0.7
type BaseOptionFunc func(o *BaseOption)
BaseOptionFunc base option func
type IBizRequest ¶
IBizRequest business tag reqquest
type IPage ¶
type IPage interface { GetPageIndex() int64 GetPageSize() int64 GetBegin() int64 GetSize() int64 GetSorts() []ISortField }
IPage page request
type IPaginator ¶
type IRepository ¶
type IRepository[T IEntity] interface { BaseCreate(ctx context.Context, ps []*T, opts ...BaseOptionFunc) (int64, error) BaseSave(ctx context.Context, ps []*T, opts ...BaseOptionFunc) (int64, error) BaseUpdate(ctx context.Context, p *T, opts ...BaseOptionFunc) (int64, error) BaseGet(ctx context.Context, opts ...BaseOptionFunc) (*T, error) BaseDelete(ctx context.Context, p *T, opts ...BaseOptionFunc) (int64, error) BaseCount(ctx context.Context, opts ...BaseOptionFunc) (int64, error) BaseQuery(ctx context.Context, opts ...BaseOptionFunc) ([]T, error) }
IRepository repo
type ISortField ¶
ISortField sort field
Click to show internal directories.
Click to hide internal directories.