types

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 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.MysqlTableColumn, error)

func ColumnToPostgresqlSchemaColumn added in v0.12.0

func ColumnToPostgresqlSchemaColumn(column *Column) (*schemasv1alpha4.PostgresqlTableColumn, error)

func ForeignKeyToMysqlSchemaForeignKey added in v0.12.0

func ForeignKeyToMysqlSchemaForeignKey(foreignKey *ForeignKey) *schemasv1alpha4.MysqlTableForeignKey

func ForeignKeyToPostgresqlSchemaForeignKey added in v0.12.0

func ForeignKeyToPostgresqlSchemaForeignKey(foreignKey *ForeignKey) *schemasv1alpha4.PostgresqlTableForeignKey

func GenerateMysqlFKName added in v0.12.0

func GenerateMysqlFKName(tableName string, schemaForeignKey *schemasv1alpha4.MysqlTableForeignKey) string

func GenerateMysqlIndexName added in v0.12.0

func GenerateMysqlIndexName(tableName string, schemaIndex *schemasv1alpha4.MysqlTableIndex) string

func GeneratePostgresqlFKName added in v0.12.0

func GeneratePostgresqlFKName(tableName string, schemaForeignKey *schemasv1alpha4.PostgresqlTableForeignKey) string

func GeneratePostgresqlIndexName added in v0.12.0

func GeneratePostgresqlIndexName(tableName string, schemaIndex *schemasv1alpha4.PostgresqlTableIndex) string

func GenerateSqliteFKName added in v0.12.0

func GenerateSqliteFKName(tableName string, schemaForeignKey *schemasv1alpha4.SqliteTableForeignKey) string

func IndexToMysqlSchemaIndex added in v0.12.0

func IndexToMysqlSchemaIndex(index *Index) *schemasv1alpha4.MysqlTableIndex

func IndexToPostgresqlSchemaIndex added in v0.12.0

func IndexToPostgresqlSchemaIndex(index *Index) *schemasv1alpha4.PostgresqlTableIndex

Types

type Column

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

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 MysqlSchemaForeignKeyToForeignKey added in v0.12.0

func MysqlSchemaForeignKeyToForeignKey(schemaForeignKey *schemasv1alpha4.MysqlTableForeignKey) *ForeignKey

func PostgresqlSchemaForeignKeyToForeignKey added in v0.12.0

func PostgresqlSchemaForeignKeyToForeignKey(schemaForeignKey *schemasv1alpha4.PostgresqlTableForeignKey) *ForeignKey

func (*ForeignKey) Equals

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

type Index

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

func MysqlSchemaIndexToIndex added in v0.12.0

func MysqlSchemaIndexToIndex(schemaIndex *schemasv1alpha4.MysqlTableIndex) *Index

func PostgresqlSchemaIndexToIndex added in v0.12.0

func PostgresqlSchemaIndexToIndex(schemaIndex *schemasv1alpha4.PostgresqlTableIndex) *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