utilities

package
v1.0.1-0...-386defc Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanRename

func CanRename(names []string, table string) (bool, error)

func CheckSpannerNamesValidity

func CheckSpannerNamesValidity(input []string) (bool, []string)

func Difference

func Difference(listone, listtwo []string) []string

Difference gives list of element that are only present in first list.

func DuplicateInArray

func DuplicateInArray(element []int) int

DuplicateInArray checks if there is any duplicate element present in the list.

func GetColIdFromSpannerName

func GetColIdFromSpannerName(conv *internal.Conv, tableId, colName string) (string, error)

func GetFilePrefix

func GetFilePrefix(now time.Time) (string, error)

func GetInterleavedFk

func GetInterleavedFk(conv *internal.Conv, tableId string, srcColId string) (schema.ForeignKey, error)

func GetMetadataDbName

func GetMetadataDbName() string

func GetPrimaryKeyIndexFromOrder

func GetPrimaryKeyIndexFromOrder(pk []ddl.IndexKey, order int) int

func GetRefColIndexFromFk

func GetRefColIndexFromFk(fk ddl.Foreignkey, colId string) int

func GetSpannerUri

func GetSpannerUri(projectId string, instanceId string) string

func GetType

func GetType(conv *internal.Conv, newType, tableId, colId string) (ddl.CreateTable, ddl.Type, error)

func InitObjectId

func InitObjectId()

func IsColumnPresent

func IsColumnPresent(columns []string, col string) int

IsColumnPresent check string is present in given list.

func IsParent

func IsParent(tableId string) (bool, string)

func IsPartOfFK

func IsPartOfFK(col, table string) bool

func IsPartOfPK

func IsPartOfPK(col, table string) bool

func IsPartOfSecondaryIndex

func IsPartOfSecondaryIndex(col, table string) (bool, string)

func IsReferencedByFK

func IsReferencedByFK(col, table string) (bool, string)

func IsSchemaIssuePresent

func IsSchemaIssuePresent(schemaissue []internal.SchemaIssue, issue internal.SchemaIssue) bool

IsSchemaIssuePresent checks if issue is present in the given schemaissue list.

func IsTypeChanged

func IsTypeChanged(newType, tableId, colId string, conv *internal.Conv) (bool, error)

func Remove

func Remove(slice []string, s int) []string

func RemoveColumnFromSecondaryIndexKey

func RemoveColumnFromSecondaryIndexKey(slice []ddl.IndexKey, s int) []ddl.IndexKey

RemoveColumnFromSecondaryIndexKey remove given column from SpannerSecondary Index Key List.

func RemoveFk

func RemoveFk(slice []ddl.Foreignkey, fkId string) []ddl.Foreignkey

func RemoveFkColumn

func RemoveFkColumn(slice []string, s int) []string

RemoveFkColumn remove given column from Spanner Foreignkey Columns List.

func RemoveFkReferColumns

func RemoveFkReferColumns(slice []string, s int) []string

removeFkReferColumns remove given column from Spanner FkReferColumns Columns List.

func RemoveIndex

func RemoveIndex(PrimaryKeys []ddl.IndexKey, index int) []ddl.IndexKey

RemoveIndex removes Primary Key from the given Primary Key list.

func RemovePk

func RemovePk(slice []ddl.IndexKey, s int) []ddl.IndexKey

func RemoveSchemaIssue

func RemoveSchemaIssue(schemaissue []internal.SchemaIssue, issue internal.SchemaIssue) []internal.SchemaIssue

RemoveSchemaIssue removes issue from the given list.

func RemoveSchemaIssues

func RemoveSchemaIssues(schemaissue []internal.SchemaIssue) []internal.SchemaIssue

RemoveSchemaIssues remove all hotspot and interleaved from given list. RemoveSchemaIssues is used when we are adding or removing primary key column from primary key.

func RemoveSecondaryIndex

func RemoveSecondaryIndex(slice []ddl.CreateIndex, s int) []ddl.CreateIndex

func UpdateDataType

func UpdateDataType(conv *internal.Conv, newType, tableId, colId string) error

func UpdateMaxColumnLen

func UpdateMaxColumnLen(conv *internal.Conv, dataType, tableId, colId string, spColLen int64) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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