Documentation ¶
Index ¶
- Constants
- func ConvertHumpToUnderline(column []byte) string
- func ConvertToLower(val []byte) string
- func ConvertToUpper(val []byte) string
- func ParseKeywordAndArgument(val string) (string, string)
- type Column
- type MysqlColumn
- func (own *MysqlColumn) AllowAutoIncrement() bool
- func (own *MysqlColumn) GenerateSQL() string
- func (own *MysqlColumn) GetBaseColumn() *baseColumn
- func (own *MysqlColumn) GetName() [2]string
- func (own *MysqlColumn) IsAutoInsert() bool
- func (own *MysqlColumn) IsIgnore() bool
- func (own *MysqlColumn) Parse(tag string)
- func (own *MysqlColumn) WithNameAndType(name string, typ string) Column
- type Name
Constants ¶
View Source
const ( UpperLetterStartIdx = 65 LowerLetterStartIdx = 97 )
Variables ¶
This section is empty.
Functions ¶
func ConvertHumpToUnderline ¶
ConvertHumpToUnderline 将驼峰英文命名转换为下划线英文命名
func ParseKeywordAndArgument ¶
Types ¶
type Column ¶
type Column interface { // Parse 解析 tag 标签信息 Parse(tag string) // GenerateSQL 生成创建数据表字段的 SQL 语句 GenerateSQL() string // WithNameAndType 重置字段名称和类型 WithNameAndType(name, typ string) Column // AllowAutoIncrement 字段类型是否允许自增 AllowAutoIncrement() bool // IsIgnore 是否忽略该字段(不关联到数据库) IsIgnore() bool // IsAutoInsert 是否为自动插入自动 IsAutoInsert() bool // GetName 获取字段名(0-数据模型字段名;1-数据表字段名) GetName() [2]string // GetBaseColumn 获取字段信息 GetBaseColumn() *baseColumn }
Column 定义数据表字段的接口类型
type MysqlColumn ¶
type MysqlColumn baseColumn
func (*MysqlColumn) AllowAutoIncrement ¶
func (own *MysqlColumn) AllowAutoIncrement() bool
func (*MysqlColumn) GenerateSQL ¶
func (own *MysqlColumn) GenerateSQL() string
func (*MysqlColumn) GetBaseColumn ¶
func (own *MysqlColumn) GetBaseColumn() *baseColumn
func (*MysqlColumn) GetName ¶
func (own *MysqlColumn) GetName() [2]string
func (*MysqlColumn) IsAutoInsert ¶
func (own *MysqlColumn) IsAutoInsert() bool
func (*MysqlColumn) IsIgnore ¶
func (own *MysqlColumn) IsIgnore() bool
func (*MysqlColumn) WithNameAndType ¶
func (own *MysqlColumn) WithNameAndType(name string, typ string) Column
Click to show internal directories.
Click to hide internal directories.