Documentation ¶
Index ¶
- Constants
- type Sharding
- func (s *Sharding) CountSharding(model ShardingModel) (count int64)
- func (s *Sharding) Create(value ShardingModel) *Sharding
- func (s *Sharding) FirstTable(out ShardingModel, isLast bool) (tableName string)
- func (s *Sharding) PaginateSharding(model ShardingModel, page, size int, fetch base.FilterFunc) error
- type ShardingModel
Constants ¶
View Source
const ( COUMT_IS_EMPTY = -1 // 尚未计数 COUMT_IS_DYNAMIC = -2 // 不缓存计数 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sharding ¶
type Sharding struct { IsTableNameDesc bool DbNameMatch string TableFilter func(dbname, table string) bool *gorm.DB // contains filtered or unexported fields }
func (*Sharding) CountSharding ¶
func (s *Sharding) CountSharding(model ShardingModel) (count int64)
Count all
func (*Sharding) Create ¶
func (s *Sharding) Create(value ShardingModel) *Sharding
Create insert the value into database
func (*Sharding) FirstTable ¶
func (s *Sharding) FirstTable(out ShardingModel, isLast bool) (tableName string)
func (*Sharding) PaginateSharding ¶
func (s *Sharding) PaginateSharding(model ShardingModel, page, size int, fetch base.FilterFunc) error
Select step by step.
type ShardingModel ¶
Click to show internal directories.
Click to hide internal directories.