mysql

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddForeignKeyStatement added in v0.2.0

func AddForeignKeyStatement(tableName string, schemaForeignKey *schemasv1alpha2.SQLTableForeignKey) string

func AddIndexStatement added in v0.2.0

func AddIndexStatement(tableName string, schemaIndex *schemasv1alpha2.SQLTableIndex) string

func AlterColumnStatement

func AlterColumnStatement(tableName string, primaryKeys []string, desiredColumns []*schemasv1alpha2.SQLTableColumn, existingColumn *types.Column) (string, error)

func CreateTableStatement

func CreateTableStatement(tableName string, tableSchema *schemasv1alpha2.SQLTableSchema) (string, error)

func DatabaseNameFromURI

func DatabaseNameFromURI(uri string) (string, error)

func DeployMysqlTable added in v0.2.0

func DeployMysqlTable(uri string, tableName string, mysqlTableSchema *schemasv1alpha2.SQLTableSchema) error

func InsertColumnStatement

func InsertColumnStatement(tableName string, desiredColumn *schemasv1alpha2.SQLTableColumn) (string, error)

func RemoveForeignKeyStatement added in v0.2.0

func RemoveForeignKeyStatement(tableName string, foreignKey *types.ForeignKey) string

func RemoveIndexStatement added in v0.2.0

func RemoveIndexStatement(tableName string, index *types.Index) string

func RenameIndexStatement added in v0.2.0

func RenameIndexStatement(tableName string, index *types.Index, schemaIndex *schemasv1alpha2.SQLTableIndex) string

Types

type AlterAddConstrantStatement added in v0.3.0

type AlterAddConstrantStatement struct {
	TableName  string
	Constraint types.KeyConstraint
}

func (AlterAddConstrantStatement) String added in v0.3.0

type AlterDropColumnStatement added in v0.3.0

type AlterDropColumnStatement struct {
	TableName string
	Column    types.Column
}

func (AlterDropColumnStatement) String added in v0.3.0

func (s AlterDropColumnStatement) String() string

type AlterModifyColumnStatement added in v0.3.0

type AlterModifyColumnStatement struct {
	TableName string
	Column    types.Column
}

func (AlterModifyColumnStatement) String added in v0.3.0

type AlterRemoveConstrantStatement added in v0.3.0

type AlterRemoveConstrantStatement struct {
	TableName  string
	Constraint types.KeyConstraint
}

func (AlterRemoveConstrantStatement) String added in v0.3.0

type MysqlConnection

type MysqlConnection struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(uri string) (*MysqlConnection, error)

func (*MysqlConnection) CheckAlive

func (m *MysqlConnection) CheckAlive(namespace string, instanceName string) (bool, error)

func (*MysqlConnection) DatabaseName

func (m *MysqlConnection) DatabaseName() string

func (*MysqlConnection) EngineVersion

func (m *MysqlConnection) EngineVersion() string

func (*MysqlConnection) GetConnection

func (m *MysqlConnection) GetConnection() *sql.Conn

func (*MysqlConnection) GetDB

func (m *MysqlConnection) GetDB() *sql.DB

func (*MysqlConnection) GetTablePrimaryKey added in v0.2.0

func (m *MysqlConnection) GetTablePrimaryKey(tableName string) (*types.KeyConstraint, error)

func (*MysqlConnection) GetTableSchema added in v0.2.0

func (m *MysqlConnection) GetTableSchema(tableName string) ([]*types.Column, error)

func (*MysqlConnection) ListTableForeignKeys added in v0.2.0

func (m *MysqlConnection) ListTableForeignKeys(databaseName string, tableName string) ([]*types.ForeignKey, error)

func (*MysqlConnection) ListTableIndexes added in v0.2.0

func (m *MysqlConnection) ListTableIndexes(databaseName string, tableName string) ([]*types.Index, error)

func (*MysqlConnection) ListTables added in v0.2.0

func (m *MysqlConnection) ListTables() ([]string, error)

Jump to

Keyboard shortcuts

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