Documentation ¶
Index ¶
- Constants
- type MySQL
- func (ss *MySQL) CompareEnums(remoteSchema *lib.Database, localSchema *lib.Database, tableName string) (sql string)
- func (ss *MySQL) Connect() (server *lib.Server, e error)
- func (ss *MySQL) CreateChangeSQL(localSchema *lib.Database, remoteSchema *lib.Database) (sql string, e error)
- func (ss *MySQL) FetchDatabaseTables(server *lib.Server, databaseName string) (tables map[string]*lib.Table, e error)
- func (ss *MySQL) FetchDatabases(server *lib.Server) (databases map[string]*lib.Database, e error)
- func (ss *MySQL) FetchEnum(server *lib.Server, tableName string) (objects []map[string]interface{})
- func (ss *MySQL) FetchEnums(server *lib.Server) (enums map[string][]map[string]interface{})
- func (ss *MySQL) FetchTableColumns(server *lib.Server, databaseName string, tableName string) (columns map[string]*lib.Column, e error)
- func (ss *MySQL) UseDatabase(server *lib.Server, databaseName string) (e error)
Constants ¶
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 ¶
MySQL contains functionality for interacting with a server
func (*MySQL) CompareEnums ¶ added in v1.1.1
func (ss *MySQL) CompareEnums(remoteSchema *lib.Database, localSchema *lib.Database, tableName string) (sql string)
CompareEnums returns a set of sql statements based on the difference between local (authority) and remote
func (*MySQL) Connect ¶ added in v1.1.0
Connect connects to a server and returns a new server object
func (*MySQL) CreateChangeSQL ¶ added in v1.1.0
func (ss *MySQL) CreateChangeSQL(localSchema *lib.Database, remoteSchema *lib.Database) (sql string, e error)
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 *lib.Server, databaseName string) (tables map[string]*lib.Table, e error)
FetchDatabaseTables fetches the complete set of tables from this database
func (*MySQL) FetchDatabases ¶
FetchDatabases fetches a set of database names from the target server populating the Databases property with a map of Database objects
func (*MySQL) FetchEnums ¶ added in v1.1.1
FetchEnums fetches enum data for all enums listed in config