gensql

package
v0.0.0-...-212a885 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

* @Author: Wangjun * @Date: 2021-06-11 18:00:32 * @LastEditTime: 2022-09-21 15:23:50 * @LastEditors: wangjun haodreams@163.com * @Description:生成code * @FilePath: \rtserviced:\go\src\gitee.com\haodreams\golib\gensql\gensql.go * hnxr

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenSQLData

func GenSQLData(xdb *gorm.DB, array interface{}) (sql string, rows [][]interface{}, err error)

func GetMapFieldFromStruct

func GetMapFieldFromStruct(class interface{}) (mp map[string]int)

*

  • @description: 成员变量和ID对应, 只查找最顶级的结构体变量
  • @param {interface{}} class
  • @return {*}

func GetStructValues

func GetStructValues(items interface{}) (values []interface{})

GetStructValues 获取设备字段对应的值

func GetTitlesFromStruct

func GetTitlesFromStruct(class interface{}) (name string, titles []string)

GetTitlesFromStruct 获取类中的成员变量和变量对应的值

Types

type Tabler

type Tabler interface {
	TableName() string
}

type Valuer

type Valuer interface {
	Value() (v driver.Value, err error)
}

Jump to

Keyboard shortcuts

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