change

package
v0.1.0-alpha.44-test2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareNilVals

func CompareNilVals(existingNil, valNil bool) *bool

have to pass if nil because of go nil issues and inability to compare nils without type info

func IntMapEqual added in v0.1.0

func IntMapEqual(m1, m2 map[string]int) bool

func MapEqual

func MapEqual(m1, m2 map[string]interface{}) bool

func MapListEqual

func MapListEqual(l1, l2 []map[string]interface{}) bool

func StringListEqual

func StringListEqual(l1, l2 []string) bool

func StringMapEqual

func StringMapEqual(m1, m2 map[string]string) bool

Types

type Change

type Change struct {
	Change      ChangeType
	Name        string
	GraphQLName string
	// store anything extra here...
	ExtraInfo   interface{}
	GraphQLOnly bool
	TSOnly      bool
	// write all for every dependency of this node: actions, connections etc
	// doesn't get files to delete. ideally, we'd call detect_dangling after?
	WriteAllForNode bool
}

type ChangeMap

type ChangeMap map[string][]Change

func (ChangeMap) ChangesExist

func (cm ChangeMap) ChangesExist(key string, l ...ChangeType) bool

TODO this needs to care about TSOnly and GraphQLOnly...

type ChangeType

type ChangeType string
const (
	AddPattern    ChangeType = "add_pattern"
	ModifyPattern ChangeType = "modify_pattern"
	RemovePattern ChangeType = "remove_pattern"

	AddNode    ChangeType = "add_node"
	RemoveNode ChangeType = "remove_node"
	ModifyNode ChangeType = "modify_node"

	AddField    ChangeType = "add_field"
	RemoveField ChangeType = "remove_field"
	ModifyField ChangeType = "modify_field"

	AddEdge    ChangeType = "add_edge"
	RemoveEdge ChangeType = "remove_edge"
	ModifyEdge ChangeType = "modify_edge"

	// brought to differentiate from edges since no connection in graphql land
	AddFieldEdge    ChangeType = "add_field_edge"
	RemoveFieldEdge ChangeType = "remove_field-edge"
	ModifyFieldEdge ChangeType = "modify_field_edge"

	AddEdgeGroup    ChangeType = "add_edge_group"
	RemoveEdgeGroup ChangeType = "remove_edge_group"
	ModifyEdgeGroup ChangeType = "modify_edge_group"

	AddAction    ChangeType = "add_action"
	RemoveAction ChangeType = "remove_action"
	ModifyAction ChangeType = "modify_action"

	AddEnum    ChangeType = "add_enum"
	RemoveEnum ChangeType = "remove_enum"
	ModifyEnum ChangeType = "modify_enum"

	AddIndex    ChangeType = "add_index"
	RemoveIndex ChangeType = "remove_index"
	ModifyIndex ChangeType = "modify_index"

	AddConstraint    ChangeType = "add_constraint"
	RemoveConstraint ChangeType = "remove_constraint"
	ModifyConstraint ChangeType = "modify_constraint"

	// TODO need to break this up to AddRows, RemoveRows, ModifyRows
	ModifiedDBRows ChangeType = "modified_dbrows"

	CreateForeignKey ChangeType = "create_foreign_key"

	AddRows    ChangeType = "add_rows"
	RemoveRows ChangeType = "remove_rows"
	ModifyRows ChangeType = "modify_rows"

	AddEdgeData    ChangeType = "add_edge_data"
	ModifyEdgeData ChangeType = "modify_edge_data"
	RemoveEdgeData ChangeType = "remove_edge_data"

	CreateUniqueConstraint ChangeType = "create_unique_constraint"
	CreateCheckConstraint  ChangeType = "create_check_constraint"
	DropCheckConstraint    ChangeType = "drop_check_constraint"
)

type CompareOption added in v0.1.0

type CompareOption func(*CompareOpts)

func AddEqualToGraphQL added in v0.1.0

func AddEqualToGraphQL() CompareOption

func RemoveEqualFromGraphQL added in v0.1.0

func RemoveEqualFromGraphQL() CompareOption

type CompareOpts added in v0.1.0

type CompareOpts struct {
	RemoveEqualFromGraphQL bool
	AddEqualToGraphQL      bool
}

Jump to

Keyboard shortcuts

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