types

package
v0.15.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 4 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 ColumnToRqliteSchemaColumn added in v0.13.3

func ColumnToRqliteSchemaColumn(column *Column) (*schemasv1alpha4.RqliteTableColumn, 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 ForeignKeyToRqliteSchemaForeignKey added in v0.13.3

func ForeignKeyToRqliteSchemaForeignKey(foreignKey *ForeignKey) *schemasv1alpha4.RqliteTableForeignKey

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 GenerateRqliteFKName added in v0.13.3

func GenerateRqliteFKName(tableName string, schemaForeignKey *schemasv1alpha4.RqliteTableForeignKey) string

func GenerateRqliteIndexName added in v0.13.3

func GenerateRqliteIndexName(tableName string, schemaIndex *schemasv1alpha4.RqliteTableIndex) string

func GenerateSqliteFKName added in v0.12.0

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

func GenerateSqliteIndexName added in v0.13.3

func GenerateSqliteIndexName(tableName string, schemaIndex *schemasv1alpha4.SqliteTableIndex) 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

func IndexToRqliteSchemaIndex added in v0.13.3

func IndexToRqliteSchemaIndex(index *Index) *schemasv1alpha4.RqliteTableIndex

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 RqliteSchemaForeignKeyToForeignKey added in v0.13.3

func RqliteSchemaForeignKeyToForeignKey(schemaForeignKey *schemasv1alpha4.RqliteTableForeignKey) *ForeignKey

func SqliteSchemaForeignKeyToForeignKey added in v0.13.3

func SqliteSchemaForeignKeyToForeignKey(schemaForeignKey *schemasv1alpha4.SqliteTableForeignKey) *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 RqliteSchemaIndexToIndex added in v0.13.3

func RqliteSchemaIndexToIndex(schemaIndex *schemasv1alpha4.RqliteTableIndex) *Index

func SqliteSchemaIndexToIndex added in v0.13.3

func SqliteSchemaIndexToIndex(schemaIndex *schemasv1alpha4.SqliteTableIndex) *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 Spec added in v0.15.0

type Spec struct {
	SourceFilename string
	Spec           []byte
}

type Specs added in v0.15.0

type Specs []Spec

func (Specs) Len added in v0.15.0

func (s Specs) Len() int

Spec sort interface implementation

func (Specs) Less added in v0.15.0

func (s Specs) Less(i, j int) bool

Ensure tables are processed before views, secondary sort is by file name

func (Specs) Swap added in v0.15.0

func (s Specs) Swap(i, j int)

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