# gorm 分库分表 **Repository Path**: Kevin-C/gorm-sharding ## Basic Information - **Project Name**: gorm 分库分表 - **Description**: 基于golang gorm写的分库分表 - **Primary Language**: Go - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2022-04-02 - **Last Updated**: 2022-04-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gorm 分库分表 #### 介绍 没找到golang gorm的分库分表组件,自己写了供参考。 #### 用到的组件 - [Snowflake](https://github.com/bwmarrin/snowflake) (雪花算法生成唯一ID) - [Gorm](https://github.com/jinzhu/gorm) (golang orm组件) #### 使用说明 1.拉取代码 ```sh $ git clone https://gitee.com/lemontree/gorm-sharding.git ``` 2.安装拓展 ```sh $ cd gorm-sharding $ go mod tidy $ go mod vendor ``` 3.手动创建测试分库分表 4.修改LoadDb数据库链接 5.多数源配制方法可参考我提交的另一个仓库,[go-admin-template](https://gitee.com/lemontree/go-admin-template)