generator

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParams

func GetParams(cmds []string, i int) (string, error)

GetParams ...

Types

type Column

type Column struct {
	StructField string
	Field       string
	Type        string
	Comment     string
}

Column 列

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator ...

func NewGenerator

func NewGenerator(db *gosql.DB) *Generator

NewGenerator ...

func (*Generator) Exec

func (g *Generator) Exec(query string) ([]map[string]interface{}, error)

Exec ...

func (*Generator) GenStruct

func (g *Generator) GenStruct(table string, tags []string) ([]byte, error)

GenStruct ...

func (*Generator) ShowTable

func (g *Generator) ShowTable(datas []map[string]interface{}, start time.Time)

ShowTable ...

type Table

type Table struct {
	Columns      []*Column
	Len          int
	OtherTags    []string
	TagLen       int
	TableName    string
	ShortName    string
	StructName   string
	Database     string
	PrimaryKey   string
	ExistTime    bool
	Schema       string // create table statements except `create table table_name`
	TableComment string
}

Table 表

Jump to

Keyboard shortcuts

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