table

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crc16Hash

func Crc16Hash(src string) string

Crc16Hash 用于16张分表

func Crc32Hash

func Crc32Hash(src string) string

Crc32Hash 用于32张分表

func Crc8Hash

func Crc8Hash(src string) string

Crc8Hash 用于8张分表

func CreateSubTable

func CreateSubTable(f func(string) string)

func DynamicTable

func DynamicTable(f func(string) string, baseTable, fieldValue string) func(db *gorm.DB) *gorm.DB

DynamicTable 动态表名 e.g. DB.Scopes(DynamicTable(Crc32Hash, "test", "小圈圈")).Find(&tests) 设置动态表名scope params: f 分表计算函数 baseTable 基础表名 fieldValue 参与分表字段

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL