export

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlterTableComments

func AlterTableComments(query *gorm.DB, models ...interface{}) *gorm.DB

更新当前数据库中的表注释,对比不一致时修改

func ConvertToml

func ConvertToml(dst interface{}, src Dict) error

将Dict转为具体对象,键名与属性名匹配时,使用toml标签或不区分大小写的方式

func CopyObject added in v0.6.1

func CopyObject(src interface{}) interface{}

复制结构体数据,如果使用json打包解包,整数会变成浮点数

func FillTableComments

func FillTableComments(query *gorm.DB, models ...interface{}) *gorm.DB

补充当前数据库中的表注释,仅当没有时才加上

func GetTableComments

func GetTableComments(query *gorm.DB, models ...interface{}) map[string]string

找出Model定义中的注释

func GetTableName added in v0.5.7

func GetTableName(obj interface{}, name string) string

func InsertRows

func InsertRows(scope *gorm.Scope, rows []Dict, verbose bool) error

往数据库中写入数据

func LoadFileData

func LoadFileData(db *gorm.DB, fname string, models []interface{}, verbose bool) (*gorm.DB, error)

将toml文件中数据导入数据库,使用表名作为section

Types

type Dict

type Dict = map[string]interface{}

type Exportor

type Exportor struct {
	Data map[string][]interface{}
}

func NewExportor

func NewExportor() *Exportor

func (*Exportor) AddObject

func (ep *Exportor) AddObject(obj interface{}, group string) bool

func (*Exportor) AddQueryResult added in v0.6.0

func (ep *Exportor) AddQueryResult(val interface{}, query *gorm.DB) (count int)

func (*Exportor) SetBuffer

func (ep *Exportor) SetBuffer(buf *bytes.Buffer) error

func (*Exportor) WriteTo

func (ep *Exportor) WriteTo(fname string) error

type Interface added in v0.6.1

type Interface interface {
	DeepCopy() interface{}
}

Jump to

Keyboard shortcuts

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