SetTableHash implements the interface doltdb.RootValue.
(ctx context.Context, tName doltdb.TableName, h hash.Hash)
| 890 | |
| 891 | // SetTableHash implements the interface doltdb.RootValue. |
| 892 | func (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. |
| 908 | func (root *RootValue) VRW() types.ValueReadWriter { |