4 Star 6 Fork 3

王军 / golib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
clickhouse.go 539 Bytes
一键复制 编辑 原始数据 按行查看 历史
王军 提交于 2023-06-02 10:23 . 修复包依赖
/*
* @Author: Wangjun
* @Date: 2022-08-19 16:17:31
* @LastEditTime: 2023-06-02 10:22:39
* @LastEditors: Wangjun
* @Description:
* @FilePath: \golib\gdb\clickhouse.go
* hnxr
*/
package gdb
import (
"gitee.com/haodreams/godriver/clickhouse"
"gorm.io/gorm"
"gorm.io/gorm/schema"
)
// 获取clickhouse数据库驱动
func GetClickhouse(dsn string) (db *gorm.DB, err error) {
return gorm.Open(clickhouse.Open(dsn), &gorm.Config{
NamingStrategy: schema.NamingStrategy{
SingularTable: true,
},
})
}
Go
1
https://gitee.com/haodreams/golib.git
git@gitee.com:haodreams/golib.git
haodreams
golib
golib
956c397b13ee

搜索帮助