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

Method IterRootObjects

core/rootvalue.go:517–531  ·  view source on GitHub ↗

IterRootObjects implements the interface doltdb.RootValue.

(ctx context.Context, cb func(name doltdb.TableName, table doltdb.RootObject) (stop bool, err error))

Source from the content-addressed store, hash-verified

515
516// IterRootObjects implements the interface doltdb.RootValue.
517func (root *RootValue) IterRootObjects(ctx context.Context, cb func(name doltdb.TableName, table doltdb.RootObject) (stop bool, err error)) error {
518 colls, err := rootobject.LoadAllCollections(ctx, root)
519 if err != nil {
520 return err
521 }
522 for _, coll := range colls {
523 err = coll.IterAll(ctx, func(rootObj objinterface.RootObject) (stop bool, err error) {
524 return cb(rootObj.Name(), rootObj)
525 })
526 if err != nil {
527 return err
528 }
529 }
530 return nil
531}
532
533// IterTables implements the interface doltdb.RootValue.
534func (root *RootValue) IterTables(ctx context.Context, cb func(name doltdb.TableName, table *doltdb.Table, sch schema.Schema) (stop bool, err error)) error {

Callers 1

DropDatabaseSchemaMethod · 0.95

Calls 3

LoadAllCollectionsFunction · 0.92
IterAllMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected