module

package
v3.2.15 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CmdNew represents the new command.
	CmdNew = &cobra.Command{
		Use:   "module",
		Short: "数据模型层",
		Long:  "创建数据库模型层: ratel module dir table_name",
		Run:   run,
	}
	AppConfig *config.Config
	Link      *query.Query
)

Functions

func CamelStr

func CamelStr(name string) string

CamelStr 下划线转驼峰

func Characters added in v3.2.15

func Characters(in string) string

func Helper

func Helper(name string) string

Types

type Argument

type Argument struct {
	Field      string
	FieldType  string
	FieldInput string
}

type Column added in v3.2.15

type Column struct {
	ColumnName    string `db:"COLUMN_NAME"`
	IsNullable    string `db:"IS_NULLABLE"`
	DataType      string `db:"DATA_TYPE"`
	ColumnKey     string `db:"COLUMN_KEY"`
	ColumnComment string `db:"COLUMN_COMMENT"`
}

Column ...

func QueryColumnPrimaryKey added in v3.2.15

func QueryColumnPrimaryKey(ctx context.Context, DbName, TableName string) (Column, error)

QueryColumn 获取数据中表中字段的信息

type Function

type Function struct {
	Type      string
	Name      string
	Argument  []Argument
	TableName string
	Mark      string
	Default   bool
}

type Index

type Index struct {
	IndexName string `db:"INDEX_NAME"`
	Field     string `db:"FIELD"`
}

func QueryIndex

func QueryIndex(ctx context.Context, DbName, TableName string) ([]Index, error)

type ModuleArg

type ModuleArg struct {
	PackageName  string
	TableName    string
	Mark         string
	FunctionList []Function
	PrimaryKey   string
	ColumnName   string
}

Jump to

Keyboard shortcuts

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