Skip to content

dongex/orm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

orm

add sharding table implement fork from beego orm v.1.12.3

how to sharding table?

    // 1. get orm instance
    ormInstance = orm.NewOrm()
    err =ormInstance.Using("default")
    
    // 2. set table name in time
    ormInstance.ShardingTable(
        func(tableName string) string {
            return tableName + "_yyyymm"
        },
    )
    
    // 3. curd data from db
    err = ormInstance.Insert(testTableModel)

About

add sharding table implement fork from beego orm v.1.12.3

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%