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, databaseName string) *schema.SchemaComparison
- func (ss *MySQL) FetchDatabase(server *schema.Server, databaseName string) (*schema.Database, error)
- func (ss *MySQL) FetchDatabases(server *schema.Server) (map[string]*schema.Database, 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" ColTypeBlob = "blob" ColTypeLongBlog = "longblob" 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, databaseName string) *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) FetchDatabase ¶ added in v1.8.28
func (*MySQL) FetchDatabases ¶
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.