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

Function LoadAllCollections

core/rootobject/collection.go:396–409  ·  view source on GitHub ↗

LoadAllCollections loads and returns all collections from the root.

(ctx context.Context, root objinterface.RootValue)

Source from the content-addressed store, hash-verified

394
395// LoadAllCollections loads and returns all collections from the root.
396func LoadAllCollections(ctx context.Context, root objinterface.RootValue) ([]objinterface.Collection, error) {
397 colls := make([]objinterface.Collection, 0, len(globalCollections))
398 for i, emptyColl := range globalCollections {
399 if emptyColl == nil || i == int(objinterface.RootObjectID_Conflicts) {
400 continue
401 }
402 coll, err := emptyColl.LoadCollection(ctx, root)
403 if err != nil {
404 return nil, err
405 }
406 colls = append(colls, coll)
407 }
408 return colls, nil
409}
410
411// LoadCollection loads the collection matching the given ID from the root.
412func LoadCollection(ctx context.Context, root objinterface.RootValue, collectionID objinterface.RootObjectID) (objinterface.Collection, error) {

Callers 3

GetAllTableNamesMethod · 0.92
GetTableNamesMethod · 0.92
IterRootObjectsMethod · 0.92

Calls 1

LoadCollectionMethod · 0.65

Tested by

no test coverage detected