MCPcopy Create free account
hub / github.com/dolthub/doltgresql / rootValueChanged

Function rootValueChanged

core/context.go:585–605  ·  view source on GitHub ↗

rootValueChanged returns whether the new root value is different from the old one

(newRoot *RootValue, root *RootValue)

Source from the content-addressed store, hash-verified

583
584// rootValueChanged returns whether the new root value is different from the old one
585func rootValueChanged(newRoot *RootValue, root *RootValue) (error, bool) {
586 if newRoot == root {
587 return nil, false
588 }
589
590 newHash, err := newRoot.HashOf()
591 if err != nil {
592 return err, false
593 }
594
595 oldHash, err := root.HashOf()
596 if err != nil {
597 return err, false
598 }
599
600 if newHash == oldHash {
601 return nil, false
602 }
603
604 return nil, true
605}
606
607// databasesInContext returns all databases found within the context values.
608func databasesInContext(ctx *sql.Context, cv *contextValues) []string {

Callers 1

Calls 1

HashOfMethod · 0.45

Tested by

no test coverage detected