Documentation ¶
Index ¶
- func AlterColumnStatement(tableName string, desiredColumns []*schemasv1alpha1.SQLTableColumn, ...) (string, error)
- func CreateTableStatement(tableName string, tableSchema *schemasv1alpha1.SQLTableSchema) (string, error)
- func DatabaseNameFromURI(uri string) (string, error)
- func InsertColumnStatement(tableName string, desiredColumn *schemasv1alpha1.SQLTableColumn) (string, error)
- func MysqlColumnToSchemaColumn(column *Column) (*schemasv1alpha1.SQLTableColumn, error)
- type Column
- type ColumnConstraints
- type MysqlConnection
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 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
Click to show internal directories.
Click to hide internal directories.