clickhouse

package
v0.0.51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

* @Author: lisheng * @Date: 2022-10-13 09:39:39 * @LastEditTime: 2023-01-06 14:13:33 * @LastEditors: lisheng * @Description: clickhouse 驱动 * @FilePath: /jf-go-kit/database/clickhouse/clickhouse.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDBEngnine

func CreateDBEngnine(user string, pwd string, addr string, port int, db string) *gorm.DB

*

  • @description: CreateDBEngnine
  • @param {string} user
  • @param {string} pwd
  • @param {string} addr
  • @param {int} port
  • @param {string} db
  • @return {*}
  • @author: liqiyuWorks

func DeleteRecordByCond

func DeleteRecordByCond(engineName string, tableName string, cond string, objPtr interface{}) (affectedRows int64, err error)

*

  • @description: D - Where 删除 根据条件查询
  • @param {string} tableName
  • @param {string} cond
  • @param {interface{}} objPtr
  • @return {*}
  • @author: liqiyuWorks

func FindRecordsByCond

func FindRecordsByCond(engineName string, tableName string, cond string, page int, pageSize int, resultSlicePtr interface{}) error

*

  • @description: R - Where 查询 根据条件查询
  • @param {string} tableName
  • @param {string} cond
  • @param {string} condValue
  • @param {int} page
  • @param {int} pageSize
  • @param {interface{}} resultSlicePtr
  • @return {*}
  • @author: liqiyuWorks

func InitCkManager

func InitCkManager() func() error

*

  • @description: 初始化CK
  • @return {*}
  • @author: liqiyuWorks

func InsertRecord

func InsertRecord(engineName string, tableName string, objPtr interface{}) (affectedRows int64, err error)

*

  • @description: C - 插入数据
  • @param {string} tableName
  • @param {string} cond
  • @param {interface{}} objPtr
  • @return {*}
  • @author: liqiyuWorks

func RegisterTable

func RegisterTable(engineName string, tableObj interface{})

*

  • @description: CK AutoMigrate
  • @param {string} engineName
  • @param {interface{}} tableObj
  • @return {*}
  • @author: liqiyuWorks

func UpdateRecordByCond

func UpdateRecordByCond(engineName string, tableName string, cond string, fieldMap map[string]interface{}) (affectedRows int64, err error)

*

  • @description: U - Where 更新 根据条件查询
  • @param {string} tableName
  • @param {string} cond
  • @param {map[string]interface{}} fieldMap
  • @return {*}
  • @author: liqiyuWorks

Types

type CkManager

type CkManager struct {
	EngineMap map[string]*gorm.DB
}
var (
	GCkManager *CkManager = new(CkManager)
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL