Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Struct2json ¶
func Struct2json(s interface{}) map[string]interface{}
Types ¶
type Config ¶
type Config struct { User string Pass string Host string Port string DB string FilesPath string File string Prefix string DTable bool DColumn bool DIndex bool DConstraint bool Optimize bool }
Config Main configuration object
type Constrain ¶
type Constrain struct { UPDATE_RULE string `json:"UPDATE_RULE"` DELETE_RULE string `json:"DELETE_RULE"` CONSTRAINT_NAME string `json:"CONSTRAINT_NAME"` COLUMN_NAME string `json:"COLUMN_NAME"` REFERENCED_TABLE_NAME string `json:"REFERENCED_TABLE_NAME"` REFERENCED_COLUMN_NAME string `json:"REFERENCED_COLUMN_NAME"` }
Constrain Constrain structure
type DBConn ¶
DBConn DBConnecition
func (*DBConn) GetConstraines ¶
GetConstraines get list of tables in a DB
func (*DBConn) GetIndexes ¶
GetIndexes get list of tables in a DB
type Field ¶
type Field struct { ORDINAL_POSITION string `json:"ORDINAL_POSITION"` COLUMN_COMMENT string `json:"COLUMN_COMMENT"` COLUMN_NAME string `json:"COLUMN_NAME"` COLUMN_DEFAULT *string `json:"COLUMN_DEFAULT"` IS_NULLABLE string `json:"IS_NULLABLE"` DATA_TYPE string `json:"DATA_TYPE"` COLUMN_TYPE string `json:"COLUMN_TYPE"` EXTRA string `json:"EXTRA"` COLUMN_KEY string `json:"COLUMN_KEY"` }
Field Field structure
type Index ¶
type Index struct { Table string `json:"Table"` Non_unique string `json:"Non_unique"` Key_name string `json:"Key_name"` Seq_in_index string `json:"Seq_in_index"` Column_name string `json:"Column_name"` Collation *string `json:"Collation"` Cardinality *string `json:"Cardinality"` Sub_part *string `json:"Sub_part"` Packed *string `json:"Packed"` Null string `json:"Null"` Index_type string `json:"Index_type"` Comment string `json:"Comment"` Index_comment string `json:"Index_comment"` }
Index Index structure
type Restore ¶
type Restore struct {
// contains filtered or unexported fields
}
Restore DB model from file
type Table ¶
type Table struct { Name string `json:"Name"` Engine string `json:"Engine"` Version int `json:"Version"` RowFormat string `json:"Row_format"` Rows int `json:"Rows"` AvgRowLength int `json:"Avg_row_length"` DataLength int `json:"Data_length"` MaxDataLength int `json:"Max_data_length"` IndexLength int `json:"Index_length"` DataFree int `json:"Data_free"` AutoIncrement *string `json:"Auto_increment"` CreateTime *string `json:"Create_time"` UpdateTime *string `json:"Update_time"` CheckTime *string `json:"Check_time"` Collation string `json:"Collation"` Checksum *string `json:"Checksum"` CreateOptions string `json:"Create_options"` Comment string `json:"Comment"` }
Table table structure
Click to show internal directories.
Click to hide internal directories.