Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTable ¶
ParseTable parses the schema and table name from table which may be like db1.t1
Types ¶
type MySQLSchema ¶
type MySQLSchema struct {
// contains filtered or unexported fields
}
MySQLSchema ...
func CreateMySQLSchema ¶
func CreateMySQLSchema(dataSourceName string) (*MySQLSchema, error)
CreateMySQLSchema ...
func (*MySQLSchema) SetVerbose ¶
func (s *MySQLSchema) SetVerbose(verbose bool)
SetVerbose sets verbose
func (*MySQLSchema) TableColumns ¶
func (s *MySQLSchema) TableColumns(table string) ([]model.TableColumn, error)
TableColumns gets the all columns by table name
type MySQLTable ¶
type MySQLTable struct { Schema string `gorm:"column:TABLE_SCHEMA"` Name string `gorm:"column:TABLE_NAME"` Comment string `gorm:"column:TABLE_COMMENT"` }
MySQLTable ...
func (MySQLTable) GetScheme ¶
func (m MySQLTable) GetScheme() string
GetScheme gets the table scheme
type MyTableColumn ¶
type MyTableColumn struct { Name string `gorm:"column:COLUMN_NAME"` Type string `gorm:"column:COLUMN_TYPE"` Extra string `gorm:"column:EXTRA"` // auto_increment Comment string `gorm:"column:COLUMN_COMMENT"` DataType string `gorm:"column:DATA_TYPE"` MaxLength sql.NullInt64 `gorm:"column:CHARACTER_MAXIMUM_LENGTH"` Nullable string `gorm:"column:IS_NULLABLE"` Default sql.NullString `gorm:"column:COLUMN_DEFAULT"` NumericPrecision sql.NullInt64 `gorm:"column:NUMERIC_PRECISION"` NumericScale sql.NullInt64 `gorm:"column:NUMERIC_SCALE"` }
MyTableColumn ...
Click to show internal directories.
Click to hide internal directories.