MCPcopy
hub / github.com/dgraph-io/dgraph / LoadFromDb

Function LoadFromDb

schema/schema.go:561–570  ·  view source on GitHub ↗

LoadFromDb reads schema information from db and stores it in memory

(ctx context.Context)

Source from the content-addressed store, hash-verified

559
560// LoadFromDb reads schema information from db and stores it in memory
561func LoadFromDb(ctx context.Context) error {
562 // Reset the state because with the introduction of incremental restore,
563 // it can't be assumed that the state would be empty before loading the
564 // schema from the DB as we don't do drop all in case of incremental restores.
565 State().DeleteAll()
566 if err := loadFromDB(ctx, loadSchema); err != nil {
567 return err
568 }
569 return loadFromDB(ctx, loadType)
570}
571
572const (
573 loadSchema int = iota

Callers 5

handleRestoreProposalFunction · 0.92
TestEmptyTypeSchemaFunction · 0.92
postStreamProcessingFunction · 0.92
StartRaftNodesFunction · 0.92
retrieveSnapshotMethod · 0.92

Calls 3

loadFromDBFunction · 0.85
DeleteAllMethod · 0.80
StateFunction · 0.70

Tested by 1

TestEmptyTypeSchemaFunction · 0.74