Documentation
¶
Index ¶
- Variables
- func GroupByColumn(indexList []*Index) map[string][]*Index
- type Column
- func (c *Column) AutoIncrement() bool
- func (c *Column) GetDataType() (fieldtype string)
- func (c *Column) IsPrimaryKey() bool
- func (c *Column) SetDataTypeMap(m map[string]func(detailType string) (dataType string))
- func (c *Column) ToField(nullable, coverable bool) *Field
- func (c *Column) WithNS(jsonTagNS, newTagNS func(columnName string) string)
- type Conf
- type CreateFieldOpt
- type Field
- type FieldConf
- type FieldOpt
- type FilterFieldOpt
- type Index
- type KeyWords
- type ModifyFieldOpt
- type SQLBuffer
- type SchemaNameOpt
- type SourceCode
- type Status
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 {
TableName string `gorm:"column:TABLE_NAME"`
ColumnName string `gorm:"column:COLUMN_NAME"`
ColumnComment string `gorm:"column:COLUMN_COMMENT"`
DataType string `gorm:"column:DATA_TYPE"`
ColumnKey string `gorm:"column:COLUMN_KEY"`
ColumnType string `gorm:"column:COLUMN_TYPE"`
ColumnDefault string `gorm:"column:COLUMN_DEFAULT"`
Extra string `gorm:"column:EXTRA"`
IsNullable string `gorm:"column:IS_NULLABLE"`
Indexes []*Index `gorm:"-"`
// contains filtered or unexported fields
}
Column table column's info
func (*Column) AutoIncrement ¶
func (*Column) GetDataType ¶
func (*Column) IsPrimaryKey ¶
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.