mysql

package
v1.8.43 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 8 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"
	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) Connect

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

Connect connects to a server and returns a new server object

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 (ss *MySQL) FetchDatabase(server *schema.Server, databaseName string) (*schema.Schema, error)

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

func (*MySQL) FetchEnum

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

func (*MySQL) FetchTableColumns

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

FetchTableColumns lists all of the columns in a table

func (*MySQL) UseDatabase

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

UseDatabase switches the connection context to the passed in database

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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