db

package
v0.0.0-...-9743816 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LinkText string

Functions

func DBConnect

func DBConnect() (*sqlx.DB, error)

Types

type ColumnModel

type ColumnModel struct {
	Name       string            // 字段名
	Type       string            // 字段类型
	IsPoint    bool              // 是否为指针类型
	Tag        map[string]string // 标签
	Annotation *string           // 注释
}

ColumnModel 字段列参数详情

func (*ColumnModel) GeneratorFunc

func (d *ColumnModel) GeneratorFunc() string

func (*ColumnModel) ToStructColumn

func (d *ColumnModel) ToStructColumn() string

ToStructColumn 字段列详情转结构体字段字符串

type DescTable

type DescTable struct {
	Field   string  `db:"Field"`   // 字段名称
	Type    string  `db:"Type"`    // 字段类型
	Null    string  `db:"Null"`    // 是否允许为空
	Key     string  `db:"Key"`     // 是否key
	Default *string `db:"Default"` // 默认值
	Comment *string `db:"Comment"` // 注释
}

func DescTableFunc

func DescTableFunc(table string) ([]DescTable, error)

func (*DescTable) RowToColumn

func (row *DescTable) RowToColumn(hump bool) *ColumnModel

RowToColumn 字段转结构体参数 依据hump判定是否驼峰算法进而生成golang结构体

Jump to

Keyboard shortcuts

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