Documentation ¶
Index ¶
- Constants
- type MySQL
- func (ss *MySQL) CompareEnums(remoteSchema *schema.Schema, localSchema *schema.Schema, tableName string) (sql string)
- func (ss *MySQL) Connect() (server *schema.Server, e error)
- func (ss *MySQL) CreateChangeSQL(localSchema *schema.Schema, remoteSchema *schema.Schema) *schema.SchemaComparison
- func (ss *MySQL) FetchDatabaseTables(server *schema.Server, databaseName string) (tables map[string]*schema.Table, e error)
- func (ss *MySQL) FetchDatabases(server *schema.Server) (databases map[string]*schema.Schema, e error)
- func (ss *MySQL) FetchEnum(server *schema.Server, tableName string) (objects []map[string]interface{})
- func (ss *MySQL) FetchTableColumns(server *schema.Server, databaseName string, tableName string) (columns map[string]*schema.Column, e error)
- func (ss *MySQL) UseDatabase(server *schema.Server, databaseName string) (e error)
Constants ¶
View Source
const ( SignedSigned = "SIGNED" SignedUnsigned = "UNSIGNED" KeyPRI = "PRI" KeyUNI = "UNI" KeyMUL = "MUL" ColTypeVarchar = "varchar" ColTypeEnum = "enum" ColTypeChar = "char" ColTypeTinyText = "tinytext" ColTypeText = "text" ColTypeMediumText = "mediumtext" ColTypeLongText = "longtext" ColTypeDecimal = "decimal" ColTypeNumeric = "numeric" ColTypeFloat = "float" ColTypeDouble = "double" ColTypeTinyint = "tinyint" ColTypeSmallint = "smallint" ColTypeMediumint = "mediumint" ColTypeInt = "int" ColTypeBigint = "bigint" ColTypeDate = "date" ColTypeDateTime = "datetime" ColTypeTime = "time" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
MySQL contains functionality for interacting with a server
func NewMySQL ¶
func NewMySQL(config *lib.ConfigDatabase) *MySQL
func (*MySQL) CompareEnums ¶
func (ss *MySQL) CompareEnums( remoteSchema *schema.Schema, localSchema *schema.Schema, tableName string, ) (sql string)
CompareEnums returns a set of sql statements based on the difference between local (authority) and remote
func (*MySQL) CreateChangeSQL ¶
func (ss *MySQL) CreateChangeSQL(localSchema *schema.Schema, remoteSchema *schema.Schema) *schema.SchemaComparison
CreateChangeSQL generates sql statements based off of comparing two database objects localSchema is authority, remoteSchema will be upgraded to match localSchema
func (*MySQL) FetchDatabaseTables ¶
func (ss *MySQL) FetchDatabaseTables(server *schema.Server, databaseName string) (tables map[string]*schema.Table, e error)
FetchDatabaseTables fetches the complete set of tables from this database
func (*MySQL) FetchDatabases ¶
func (ss *MySQL) FetchDatabases(server *schema.Server) (databases map[string]*schema.Schema, e error)
FetchDatabases fetches a set of database names from the target server populating the Databases property with a map of Database objects
Click to show internal directories.
Click to hide internal directories.