db

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDatabaseClient

func GetDatabaseClient(name string) (db *sqlx.DB, err error)

func SaveDynamic added in v0.1.20

func SaveDynamic(db *sqlx.DB, table string, dataMap map[string]interface{})

SaveDynamic @Description: save directly @param db @param table @param dataMap

func SaveOrUpdateDynamic added in v0.1.19

func SaveOrUpdateDynamic(db *sqlx.DB, table string, dataMap map[string]interface{}, findMap map[string]interface{}, duplicatedUpdate bool)

SaveOrUpdateDynamic @Description: save or update by dict, dynamic generate insert/update sql @param db connection of database @param table table name @param dataMap value map @param findMap primary key to find row existed @param duplicatedUpdate true, update where row existed; false, skip

func UpdateDynamic added in v0.1.19

func UpdateDynamic(db *sqlx.DB, table string, dataMap map[string]interface{}, findMap map[string]interface{})

UpdateDynamic @Description: update directly @param db @param table @param dataMap @param findMap

Types

This section is empty.

Jump to

Keyboard shortcuts

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