Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DBTypeToStructType = map[string]string{
"int": "int32",
"tinyint": "int8",
"smallint": "int",
"mediumint": "int64",
"bigint": "int64",
"bit": "int",
"bool": "bool",
"enum": "string",
"set": "string",
"varchar": "string",
"char": "string",
"tinytext": "string",
"mediumtext": "string",
"text": "string",
"longtext": "string",
"blob": "string",
"tinyblob": "string",
"mediumblob": "string",
"longblob": "string",
"date": "time.Time",
"datetime": "time.Time",
"timestamp": "time.Time",
"time": "time.Time",
"float": "float64",
"double": "float64",
}
Functions ¶
This section is empty.
Types ¶
type DBModel ¶
func NewDBModel ¶
func (*DBModel) GetColumns ¶
func (m *DBModel) GetColumns(dbName string, tableName string) ([]*TableColumn, error)
type StructTemplate ¶
type StructTemplate struct {
// contains filtered or unexported fields
}
func NewStructTemplate ¶
func NewStructTemplate() *StructTemplate
func (*StructTemplate) AssemblyColumns ¶
func (t *StructTemplate) AssemblyColumns(tbColumns []*TableColumn) []*StructColumn
func (*StructTemplate) Generate ¶
func (t *StructTemplate) Generate(tableName string, tplColumns []*StructColumn) error
type StructTemplateDB ¶
type StructTemplateDB struct { TableName string Columns []*StructColumn }
Click to show internal directories.
Click to hide internal directories.