Documentation ¶
Overview ¶
* @Author: lisheng * @Date: 2022-10-18 15:04:49 * @LastEditTime: 2023-01-06 14:16:12 * @LastEditors: lisheng * @Description: PostareSQL驱动 * @FilePath: /jf-go-kit/database/pg/pg.go
Index ¶
- func CreateDBEngnine(user string, pwd string, addr string, port int, db string) *gorm.DB
- func DeleteRecordByCond(engineName string, tableName string, cond string, objPtr interface{}) (affectedRows int64, err error)
- func FindRecordsByCond(engineName string, tableName string, cond string, page int, pageSize int, ...) error
- func InitPgManager() func() error
- func InsertRecord(engineName string, tableName string, objPtr interface{}) (affectedRows int64, err error)
- func RegisterTable(engineName string, tableObj interface{})
- func UpdateRecordByCond(engineName string, tableName string, cond string, ...) (affectedRows int64, err error)
- type PgManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDBEngnine ¶
*
- @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 InitPgManager ¶
func InitPgManager() func() error
*
- @description: 初始化PG
- @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: RegisterTable
- @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 ¶
Click to show internal directories.
Click to hide internal directories.