types

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnToSchemaColumn

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

func ForeignKeyToSchemaForeignKey

func ForeignKeyToSchemaForeignKey(foreignKey *ForeignKey) *schemasv1alpha2.SQLTableForeignKey

func GenerateFKName

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

func GenerateIndexName

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

func IndexToSchemaIndex

func IndexToSchemaIndex(index *Index) *schemasv1alpha2.SQLTableIndex

func NotNullConstraintEquals added in v0.3.0

func NotNullConstraintEquals(a, b *bool) bool

Types

type Column

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

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 *schemasv1alpha2.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 *schemasv1alpha2.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

Jump to

Keyboard shortcuts

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