# common-db **Repository Path**: moses-studio/common-db ## Basic Information - **Project Name**: common-db - **Description**: 公共组件,数据库封装common-db - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-02 - **Last Updated**: 2026-07-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## Config ## v1 用于财讯通项目 ## v2 1.剥离v1版本写死的配置项 2.可配置多个数据源,如db1,db2 ## 用法 import "fipdev.dfitc.com.cn/FFSP/db/v2" // 连接信息 dbSources := []string{ "root:CXT@dlfc#2021%@tcp(170.0.39.2:3306)/infoservice?charset=utf8", "root:Mysql@123@tcp(170.0.33.144:3306)/auth_center?charset=utf8", } // 初始化数据库 if err := db.Init("mysql", dbSources, 20, 20); err != nil { ... } // 获取连接 session := db.Session("infoservice") ...