model

package
v0.0.0-...-acc9957 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 1 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 {
	ColName      string
	IsPrimaryKey bool
	GoName       string
	GoType       string
}

func (*Field) IsBool

func (f *Field) IsBool() bool

func (*Field) IsFloat

func (f *Field) IsFloat() bool

func (*Field) IsInteger

func (f *Field) IsInteger() bool

func (*Field) IsPtr

func (f *Field) IsPtr() bool

func (*Field) IsSlice

func (f *Field) IsSlice() bool

func (*Field) IsString

func (f *Field) IsString() bool

type Method

type Method struct {
	FuncName    string
	SqlType     string
	SqlSentence string
	Params      []Parameter
	Results     []string
}

func (Method) IsError

func (m Method) IsError(t string) bool

func (Method) IsFloat

func (m Method) IsFloat(t string) bool

func (Method) IsInteger

func (m Method) IsInteger(t string) bool

func (Method) IsSlice

func (m Method) IsSlice(t string) bool

func (Method) QuotedColOfSqlParams

func (m Method) QuotedColOfSqlParams() []string

func (Method) QuotedFunc

func (m Method) QuotedFunc() string

type Model

type Model struct {
	TableName    string
	GoName       string
	Fields       []Field
	SelfPkgName  string
	PkgName      string
	ExtralImport string
	Methods      []Method
}

Model 模型定义

func (*Model) AddToString

func (*Model) AddToString(cols []string) string

func (*Model) InsertWithReplaceParameter

func (m *Model) InsertWithReplaceParameter() string

func (*Model) QuotedAllCol

func (m *Model) QuotedAllCol() []string

func (*Model) QuotedColOfSql

func (md *Model) QuotedColOfSql(m Method) string

func (*Model) QuotedExecArgsWithParameter

func (m *Model) QuotedExecArgsWithParameter(col []string, flag, owner string) string

func (*Model) QuotedGoNameOfSqlParam

func (md *Model) QuotedGoNameOfSqlParam(Sql string) []string

func (*Model) QuotedRelationship

func (m *Model) QuotedRelationship() map[string]string

func (*Model) QuotedTableName

func (m *Model) QuotedTableName() string

func (*Model) WrapData

func (m *Model) WrapData(method Method) map[string]interface{}

type Option

type Option func(m *Model)

func WithImports

func WithImports(imports string) Option

type Parameter

type Parameter struct {
	GoName string
	GoType string // []byte
	Exist  bool
	HasLen bool
}

type PkgInfor

type PkgInfor struct {
	PkgName      string
	ExtralImport string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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