Documentation ¶
Index ¶
- type Config
- type Keys
- type Model
- func (m *Model) BasicDataType(columnType *builder.ColumnType) reflect.Type
- func (m *Model) ColumnTag(column *builder.Column) map[string]reflectx.StructTag
- func (m *Model) FieldType(file *codegen.File, fieldName string) codegen.SnippetType
- func (m *Model) Generator() error
- 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) IteratorType() codegen.SnippetType
- 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 StructFields []*builder.StructField FieldKeyAutoIncrement string HasDeletedAt bool HasCreatedAt bool HasUpdatedAt bool HasAutoIncrement bool }
func NewModelsFromDataBase ¶ added in v1.0.2
func (*Model) BasicDataType ¶ added in v1.0.2
func (m *Model) BasicDataType(columnType *builder.ColumnType) reflect.Type
func (*Model) GetColDescriptions ¶
func (*Model) GetComments ¶
func (*Model) GetRelations ¶
func (*Model) IndexFieldNames ¶
func (*Model) IteratorType ¶
func (m *Model) IteratorType() codegen.SnippetType
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 ¶
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.