Documentation
¶
Index ¶
- type Config
- type Keys
- type Model
- func (m *Model) FieldType(file *codegen.File, fieldName string) codegen.SnippetType
- func (m *Model) GetColDescriptions() map[string][]string
- func (m *Model) GetComments() map[string]string
- func (m *Model) GetRelations() map[string][]string
- func (m *Model) IndexFieldNames() []string
- func (m *Model) PtrType() codegen.SnippetType
- func (m *Model) Type() codegen.SnippetType
- func (m *Model) VarTable() string
- func (m *Model) WriteBatchList(file *codegen.File)
- func (m *Model) WriteByKey(file *codegen.File)
- func (m *Model) WriteCRUD(file *codegen.File)
- func (m *Model) WriteCount(file *codegen.File)
- func (m *Model) WriteCreate(file *codegen.File)
- func (m *Model) WriteDelete(file *codegen.File)
- func (m *Model) WriteList(file *codegen.File)
- func (m *Model) WriteTableInterfaces(file *codegen.File)
- func (m *Model) WriteTableKeyInterfaces(file *codegen.File)
- func (m *Model) WriteTableName(file *codegen.File)
- func (m *Model) WriteTo(file *codegen.File)
- type SqlFuncGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
StructName string
TableName string
Database string
WithComments bool
WithTableName bool
WithTableInterfaces bool
WithMethods bool
FieldPrimaryKey string
FieldKeyDeletedAt string
FieldKeyCreatedAt string
FieldKeyUpdatedAt string
}
func (*Config) SetDefaults ¶
func (g *Config) SetDefaults()
type Keys ¶
func (*Keys) PatchUniqueIndexesWithSoftDelete ¶
type Model ¶
type Model struct {
*types.TypeName
*Config
*Keys
*builder.Table
Fields map[string]*types.Var
FieldKeyAutoIncrement string
HasDeletedAt bool
HasCreatedAt bool
HasUpdatedAt bool
HasAutoIncrement bool
}
func (*Model) GetColDescriptions ¶ added in v2.5.0
func (*Model) GetComments ¶
func (*Model) GetRelations ¶ added in v2.3.0
func (*Model) IndexFieldNames ¶
func (*Model) PtrType ¶
func (m *Model) PtrType() codegen.SnippetType
func (*Model) Type ¶
func (m *Model) Type() codegen.SnippetType
func (*Model) WriteBatchList ¶
func (*Model) WriteByKey ¶
func (*Model) WriteCount ¶
func (*Model) WriteCreate ¶
func (*Model) WriteDelete ¶
func (*Model) WriteTableInterfaces ¶
func (*Model) WriteTableKeyInterfaces ¶
func (*Model) WriteTableName ¶ added in v2.8.2
type SqlFuncGenerator ¶
type SqlFuncGenerator struct {
Config
// contains filtered or unexported fields
}
func NewSqlFuncGenerator ¶
func NewSqlFuncGenerator(pkg *packagesx.Package) *SqlFuncGenerator
func (*SqlFuncGenerator) Output ¶
func (g *SqlFuncGenerator) Output(cwd string)
func (*SqlFuncGenerator) Scan ¶
func (g *SqlFuncGenerator) Scan()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.