generator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	DatabaseName string
	SQLType      string
	IsPrimaryKey bool
	GoType       reflect.Type
	GoName       string
	DALfmt       string
	DTOfmt       string
}

Field collection of var about one column.

type ModelInfo

type ModelInfo struct {
	Module          string
	StructName      string
	ShortStructName string
	IsTable         bool
	TableName       string
	IsView          bool
	ViewName        string
	Fields          []Field
	Import          map[string]bool
	IDName          string
	IDType          string
	DBImport        string
	JSONobj         string
}

ModelInfo Object pass to Generator, to Generate DTO,DAL.

func GenerateStruct

func GenerateStruct(module, tableName string, viewName string, cols []*sql.ColumnType, primarykeys []string, dbImport string) *ModelInfo

GenerateStruct generates a struct for the given table.

Jump to

Keyboard shortcuts

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