tabledependency

package
v0.4.39 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineCycleStarts added in v0.4.24

func DetermineCycleStarts(
	cycles [][]string,
	subsets map[string]string,
	dependencyMap map[string][]*sqlmanager_shared.ForeignConstraint,
) ([]string, error)

func FindCircularDependencies added in v0.4.24

func FindCircularDependencies(dependencies map[string][]string) [][]string

Types

type ConstraintColumns

type ConstraintColumns struct {
	NullableColumns    []string
	NonNullableColumns []string
}

type DependsOn

type DependsOn struct {
	Table   string
	Columns []string
}

type OrderedTablesResult

type OrderedTablesResult struct {
	OrderedTables []string
	HasCycles     bool
}

func GetTablesOrderedByDependency

func GetTablesOrderedByDependency(dependencyMap map[string][]string) (*OrderedTablesResult, error)

type RunConfig

type RunConfig struct {
	Table         string // schema.table
	SelectColumns []string
	InsertColumns []string
	DependsOn     []*DependsOn
	RunType       RunType
	PrimaryKeys   []string
	WhereClause   *string
	SelectQuery   *string
}

func GetRunConfigs

func GetRunConfigs(
	dependencyMap map[string][]*sqlmanager_shared.ForeignConstraint,
	subsets map[string]string,
	primaryKeyMap map[string][]string,
	tableColumnsMap map[string][]string,
) ([]*RunConfig, error)

type RunType

type RunType string
const (
	RunTypeUpdate RunType = "update"
	RunTypeInsert RunType = "insert"
)

type TableColumn

type TableColumn struct {
	Schema  string
	Table   string
	Columns []string
}

Jump to

Keyboard shortcuts

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