Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetColumnInfo ¶
*
- 获取表的结构信息 *
- select column_name, data_type, column_comment from information_schema.columns
- where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position *
- 增加 column_key 标识主键
Types ¶
type ColumnInfo ¶
type ColumnInfo struct { ColumnName string JDBCType string ColumnComment string ColumnKey string // 可判断是不是主键 “PRI” 为主键 }
func (*ColumnInfo) DataType ¶
func (c *ColumnInfo) DataType() string
func (*ColumnInfo) LowerCamelName ¶
func (c *ColumnInfo) LowerCamelName() string
func (*ColumnInfo) StdJDBCType ¶
func (c *ColumnInfo) StdJDBCType() string
func (*ColumnInfo) UpperCamelName ¶
func (c *ColumnInfo) UpperCamelName() string
type TableInfo ¶
type TableInfo struct { TableName string // 原始表名 BeanName string // Java bean Name TableComment string Columns []ColumnInfo }
func GetTableInfo ¶
*
- 获取表的信息 *
- select table_name, table_comment, create_time, update_time
- from information_schema.tables
- where table_comment != ” and table_schema = (select database())
- and table_name = 'u_user'
Click to show internal directories.
Click to hide internal directories.