Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldSchema ¶
type FieldSchema struct { ColumnName string `json:"columnName" description:"列名"` ColumnType string `json:"columnType" description:"列的完整类型(DataType + DataLength)"` ColumnNullable bool `json:"columnNullable,omitempty" description:""` ColumnDefault string `json:"columnDefault,omitempty" description:"列默认值"` ColumnComment string `json:"columnComment,omitempty" description:"列注释"` DataType string `json:"dataType,omitempty" description:"列数据类型"` FieldName string `json:"fieldName,omitempty" description:"对应结构体的字段名"` FieldType string `json:"fieldType,omitempty" description:"对应结构体的字段类型"` }
func (*FieldSchema) ColumnDefaultVal ¶
func (this *FieldSchema) ColumnDefaultVal() interface{}
func (*FieldSchema) ParseValue ¶
func (this *FieldSchema) ParseValue(val string) interface{}
type IndexSchema ¶
type StructFormatter ¶
type StructFormatter struct { NameFormatter func(database, table string) string FieldNameFormatter func(database, table string, column *FieldSchema) string FieldTypeFormatter func(database, table string, column *FieldSchema) string }
type TableSchema ¶
type TableSchema struct { Database string `json:"database"` Table string `json:"table"` Type string `json:"type"` StructName string `json:"structName,omitempty"` TableComment string `json:"tableComment,omitempty"` Fields []*FieldSchema `json:"fields,omitempty"` Indexes []*IndexSchema `json:"indexes,omitempty"` }
func GetTableSchema ¶
func GetTableSchema(db DbQuery, database, table string, formatter ...*StructFormatter) (*TableSchema, error)
func (*TableSchema) GetFieldSchema ¶
func (this *TableSchema) GetFieldSchema(column string) *FieldSchema
func (*TableSchema) GetIndexSchema ¶
func (this *TableSchema) GetIndexSchema(columns []string, checkOrder bool) *IndexSchema
func (*TableSchema) GetUniqueSchema ¶
func (this *TableSchema) GetUniqueSchema(columns []string) *IndexSchema
Click to show internal directories.
Click to hide internal directories.