Documentation
¶
Overview ¶
Package graph contains all graphing algorithms used
the graph package contains all functions that relate to graphs such as the DFS implementation as well as the cycle resolution code
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CyclicError ¶
type CyclicError struct {
// contains filtered or unexported fields
}
CyclicError is a custom error that is created when cycles are detected in the database schema
func (CyclicError) Error ¶
func (e CyclicError) Error() string
Error returns a formatted string informing the user of all detected cycles in the database
type MissingTableError ¶
type MissingTableError struct {
// contains filtered or unexported fields
}
MissingTableError is a custom error that is created when a given table can not be found in the database
func (MissingTableError) Error ¶
func (e MissingTableError) Error() string
Error returns a formated string that informs the user that the table does not exist in the database
type Ordering ¶
type Ordering struct {
// contains filtered or unexported fields
}
Ordering is a struct that contains the information necessary to detect and remove cycles
func NewOrdering ¶
NewOrdering returns the address of a properly initiated Ordering struct
func (*Ordering) GetAndResolveCycles ¶
func (tl *Ordering) GetAndResolveCycles()
GetAndResolveCycles immediately runs the suggestion queries instead of returning them unlike GetSuggestionQueries
func (*Ordering) GetCycles ¶
GetCycles uses DFS to detect cycles, all detected cycles are added to a linked list and returned
func (*Ordering) GetOrder ¶
GetOrder returns a list of table names that need entries before the given table can receive an entry alongside any errors that occur
func (*Ordering) GetSuggestionQueries ¶
GetSuggestionQueries returns a list of queries necessary to remove found cycles in the database schema