mysql

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 {
	Config *lib.Config
}

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

func (ss *MySQL) Connect() (server *lib.Server, e error)

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

func (ss *MySQL) FetchDatabases(server *lib.Server) (databases map[string]*lib.Database, e error)

FetchDatabases fetches a set of database names from the target server populating the Databases property with a map of Database objects

func (*MySQL) FetchEnum added in v1.5.0

func (ss *MySQL) FetchEnum(server *lib.Server, tableName string) (objects []map[string]interface{})

func (*MySQL) FetchEnums added in v1.1.1

func (ss *MySQL) FetchEnums(server *lib.Server) (enums map[string][]map[string]interface{})

FetchEnums fetches enum data for all enums listed in config

func (*MySQL) FetchTableColumns

func (ss *MySQL) FetchTableColumns(server *lib.Server, databaseName string, tableName string) (columns map[string]*lib.Column, e error)

FetchTableColumns lists all of the columns in a table

func (*MySQL) UseDatabase

func (ss *MySQL) UseDatabase(server *lib.Server, databaseName string) (e error)

UseDatabase switches the connection context to the passed in database

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL