mysql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlterColumnStatement

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

func CreateTableStatement

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

func DatabaseNameFromURI

func DatabaseNameFromURI(uri string) (string, error)

func InsertColumnStatement

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

func MysqlColumnToSchemaColumn

func MysqlColumnToSchemaColumn(column *Column) (*schemasv1alpha1.SQLTableColumn, error)

Types

type Column

type Column struct {
	Name          string
	DataType      string
	ColumnDefault *string
	Constraints   *ColumnConstraints
}

type ColumnConstraints

type ColumnConstraints struct {
	NotNull *bool
}

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

Jump to

Keyboard shortcuts

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