types

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolsEqual added in v0.10.4

func BoolsEqual(a, b *bool) bool

func ColumnToMysqlSchemaColumn added in v0.11.0

func ColumnToMysqlSchemaColumn(column *Column) (*schemasv1alpha4.MysqlSQLTableColumn, error)

func ColumnToSchemaColumn

func ColumnToSchemaColumn(column *Column) (*schemasv1alpha4.SQLTableColumn, error)

func ForeignKeyToSchemaForeignKey

func ForeignKeyToSchemaForeignKey(foreignKey *ForeignKey) *schemasv1alpha4.SQLTableForeignKey

func GenerateFKName

func GenerateFKName(tableName string, schemaForeignKey *schemasv1alpha4.SQLTableForeignKey) string

func GenerateIndexName

func GenerateIndexName(tableName string, schemaIndex *schemasv1alpha4.SQLTableIndex) string

func IndexToSchemaIndex

func IndexToSchemaIndex(index *Index) *schemasv1alpha4.SQLTableIndex

Types

type Column

type Column struct {
	Name          string
	DataType      string
	ColumnDefault *string
	Constraints   *ColumnConstraints
	Attributes    *ColumnAttributes
	IsArray       bool
	Charset       string
	Collation     string
}

type ColumnAttributes added in v0.10.4

type ColumnAttributes struct {
	AutoIncrement *bool
}

type ColumnConstraints

type ColumnConstraints struct {
	NotNull *bool
}

type ForeignKey

type ForeignKey struct {
	ChildColumns  []string
	ParentTable   string
	ParentColumns []string
	Name          string
	OnDelete      string
}

func SchemaForeignKeyToForeignKey

func SchemaForeignKeyToForeignKey(schemaForeignKey *schemasv1alpha4.SQLTableForeignKey) *ForeignKey

func (*ForeignKey) Equals

func (fk *ForeignKey) Equals(other *ForeignKey) bool

type Index

type Index struct {
	Columns  []string
	Name     string
	IsUnique bool
}

func SchemaIndexToIndex

func SchemaIndexToIndex(schemaIndex *schemasv1alpha4.SQLTableIndex) *Index

func (*Index) Equals

func (idx *Index) Equals(other *Index) bool

type KeyConstraint added in v0.3.0

type KeyConstraint struct {
	Name      string
	Columns   []string
	IsPrimary bool
}

func (*KeyConstraint) Equals added in v0.3.0

func (k *KeyConstraint) Equals(other *KeyConstraint) bool

func (*KeyConstraint) GenerateName added in v0.3.0

func (k *KeyConstraint) GenerateName(tableName string) string

type Table added in v0.11.0

type Table struct {
	Name      string
	Charset   string
	Collation string
}

Jump to

Keyboard shortcuts

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