open.go 412 B

12345678910111213141516171819202122232425
  1. package olap
  2. import (
  3. "github.com/ClickHouse/clickhouse-go/v2/lib/driver"
  4. "gorm.io/gorm"
  5. )
  6. var defaultOlapConn driver.Conn
  7. var gormClickhouse *gorm.DB
  8. // GetOlapManager return OLAP manager
  9. func GetOlapManager() driver.Conn {
  10. if defaultOlapConn == nil {
  11. Setup()
  12. }
  13. return defaultOlapConn
  14. }
  15. func GetClickhouseOrm() *gorm.DB {
  16. if gormClickhouse == nil {
  17. setClickhouseOrm()
  18. }
  19. return gormClickhouse
  20. }