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

Method SetTableHash

core/rootvalue.go:892–905  ·  view source on GitHub ↗

SetTableHash implements the interface doltdb.RootValue.

(ctx context.Context, tName doltdb.TableName, h hash.Hash)

Source from the content-addressed store, hash-verified

890
891// SetTableHash implements the interface doltdb.RootValue.
892func (root *RootValue) SetTableHash(ctx context.Context, tName doltdb.TableName, h hash.Hash) (doltdb.RootValue, error) {
893 // TODO: error for root object tables?
894 val, err := root.vrw.ReadValue(ctx, h)
895 if err != nil {
896 return nil, err
897 }
898
899 ref, err := types.NewRef(val, root.vrw.Format())
900 if err != nil {
901 return nil, err
902 }
903
904 return root.putTable(ctx, tName, ref)
905}
906
907// VRW implements the interface doltdb.RootValue.
908func (root *RootValue) VRW() types.ValueReadWriter {

Callers

nothing calls this directly

Calls 2

putTableMethod · 0.95
FormatMethod · 0.65

Tested by

no test coverage detected