Versions in this module Expand all Collapse all v1 v1.2.0 Feb 13, 2023 Changes in this version type QueryStructMeta + InternalModelStructName string v1.1.2 Dec 13, 2022 v1.1.1 Dec 13, 2022 v1.1.0 Dec 13, 2022 Changes in this version + func GetStructNames(bases []*QueryStructMeta) (names []string) + func ParseStructRelationShip(relationship *schema.Relationships) []field.Relation + type Clause interface + Create func() string + String func() string + type ElseClause struct + func (e ElseClause) Create() string + func (e ElseClause) Finish() string + func (e ElseClause) String() (res string) + type FieldParser interface + GetFieldGenType func(f *schema.Field) string + type ForClause struct + ForRange ForRange + Value []Clause + func (f ForClause) Create() string + func (f ForClause) Finish() string + func (f ForClause) String() string + type ForRange struct + func (f *ForRange) String() string + type ITableInfo interface + GetTableColumns func(schemaName string, tableName string) (result []*model.Column, err error) + GetTableIndex func(schemaName string, tableName string) (indexes []gorm.Index, err error) + type IfClause struct + Value []Clause + func (i IfClause) Create() string + func (i IfClause) Finish() string + func (i IfClause) String() string + type InterfaceMethod struct + Doc string + GormOption string + HasForParams bool + InterfaceName string + MethodName string + OriginStruct parser.Param + Package string + Params []parser.Param + Result []parser.Param + ResultData parser.Param + S string + SQLParams []parser.Param + SQLString string + Section *Section + Table string + TargetStruct string + func BuildDIYMethod(f *parser.InterfaceSet, s *QueryStructMeta, data []*InterfaceMethod) (checkResults []*InterfaceMethod, err error) + func (m *InterfaceMethod) DocComment() string + func (m *InterfaceMethod) FuncSign() string + func (m *InterfaceMethod) GetAssertInTmpl() string + func (m *InterfaceMethod) GetParamInTmpl() string + func (m *InterfaceMethod) GetResultParamInTmpl() string + func (m *InterfaceMethod) GetTestParamInTmpl() string + func (m *InterfaceMethod) GetTestResultParamInTmpl() string + func (m *InterfaceMethod) GormRunMethodName() string + func (m *InterfaceMethod) HasGotPoint() bool + func (m *InterfaceMethod) HasNeedNewResult() bool + func (m *InterfaceMethod) HasSQLData() bool + func (m *InterfaceMethod) IsRepeatFromDifferentInterface(newMethod *InterfaceMethod) bool + func (m *InterfaceMethod) IsRepeatFromSameInterface(newMethod *InterfaceMethod) bool + func (m *InterfaceMethod) ReturnError() bool + func (m *InterfaceMethod) ReturnRowsAffected() bool + func (m *InterfaceMethod) SQLParamName(param string) string + type QueryStructMeta struct + Fields []*model.Field + FileName string + Generated bool + ImportPkgPaths []string + ModelMethods []*parser.Method + ModelStructName string + QueryStructName string + S string + Source model.SourceCode + StructInfo parser.Param + TableName string + func ConvertStructs(db *gorm.DB, structs ...interface{}) (metas []*QueryStructMeta, err error) + func GetQueryStructMeta(db *gorm.DB, conf *model.Config) (*QueryStructMeta, error) + func GetQueryStructMetaFromObject(obj helper.Object, conf *model.Config) (*QueryStructMeta, error) + func (b *QueryStructMeta) HasField() bool + func (b *QueryStructMeta) Relations() (result []field.Relation) + func (b *QueryStructMeta) ReturnObject() string + func (b *QueryStructMeta) ReviseDIYMethod() error + func (b *QueryStructMeta) ReviseFieldName() + func (b *QueryStructMeta) ReviseFieldNameFor(keywords model.KeyWord) + func (b *QueryStructMeta) StructComment() string + func (b QueryStructMeta) IfaceMode(on bool) *QueryStructMeta + type SQLClause struct + Value []string + func (s SQLClause) Create() string + func (s SQLClause) Finish() string + func (s SQLClause) String() string + type Section struct + ClauseTotal map[model.Status]int + Tmpls []string + func NewSection() *Section + func (s *Section) BuildSQL() ([]Clause, error) + func (s *Section) GetName(status model.Status) string + func (s *Section) HasMore() bool + func (s *Section) IsNull() bool + func (s *Section) SubIndex() + type SetClause struct + Value []Clause + func (s SetClause) Create() string + func (s SetClause) Finish(name string) string + func (s SetClause) String() string + type WhereClause struct + Value []Clause + func (w WhereClause) Create() string + func (w WhereClause) Finish(name string) string + func (w WhereClause) String() string