Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GenKeywords = KeyWords{ // contains filtered or unexported fields }
View Source
var GormKeywords = KeyWords{ // contains filtered or unexported fields }
Functions ¶
func GroupByColumn ¶
Types ¶
type Column ¶
type Column struct { gorm.ColumnType TableName string `gorm:"column:TABLE_NAME"` Indexes []*Index `gorm:"-"` UseScanType bool `gorm:"-"` // contains filtered or unexported fields }
Column table column's info
func (*Column) GetDataType ¶
func (*Column) SetDataTypeMap ¶
type Conf ¶
type Conf struct { ModelPkg string TablePrefix string TableName string ModelName string ImportPkgPaths []string SchemaNameOpts []SchemaNameOpt TableNameNS func(tableName string) string ModelNameNS func(tableName string) string FileNameNS func(tableName string) string FieldConf }
Conf model configuration
type CreateFieldOpt ¶
type CreateFieldOpt ModifyFieldOpt
func (CreateFieldOpt) Operator ¶
func (o CreateFieldOpt) Operator() func(*Field) *Field
type Field ¶
type Field struct { Name string Type string ColumnName string ColumnComment string MultilineComment bool JSONTag string GORMTag string NewTag string OverwriteTag string Relation *field.Relation }
Field user input structures
func (*Field) EscapeKeyword ¶
func (*Field) IsRelation ¶
type FieldConf ¶
type FieldConf struct { DataTypeMap map[string]func(detailType string) (dataType string) FieldNullable bool // generate pointer when field is nullable FieldCoverable bool // generate pointer when field has default value FieldWithIndexTag bool // generate with gorm index tag FieldWithTypeTag bool // generate with gorm column type tagl FieldJSONTagNS func(columnName string) string FieldNewTagNS func(columnName string) string FieldOpts []FieldOpt }
FieldConf field configuration
type FilterFieldOpt ¶
type FilterFieldOpt ModifyFieldOpt
func (FilterFieldOpt) Operator ¶
func (o FilterFieldOpt) Operator() func(*Field) *Field
type Index ¶
type Index struct { TableName string `gorm:"column:TABLE_NAME"` ColumnName string `gorm:"column:COLUMN_NAME"` IndexName string `gorm:"column:INDEX_NAME"` SeqInIndex int32 `gorm:"column:SEQ_IN_INDEX"` NonUnique int32 `gorm:"column:NON_UNIQUE"` }
Index table index info
func (*Index) IsPrimaryKey ¶
type ModifyFieldOpt ¶
func (ModifyFieldOpt) Operator ¶
func (o ModifyFieldOpt) Operator() func(*Field) *Field
type SchemaNameOpt ¶
Click to show internal directories.
Click to hide internal directories.