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

Method putTable

core/rootvalue.go:926–937  ·  view source on GitHub ↗

putTable provides an inner implementation that is called from multiple other functions.

(ctx context.Context, tName doltdb.TableName, ref types.Ref)

Source from the content-addressed store, hash-verified

924
925// putTable provides an inner implementation that is called from multiple other functions.
926func (root *RootValue) putTable(ctx context.Context, tName doltdb.TableName, ref types.Ref) (doltdb.RootValue, error) {
927 if !doltdb.IsValidTableName(tName.Name) {
928 panic("Don't attempt to put a table with a name that fails the IsValidTableName check")
929 }
930
931 newStorage, err := root.st.EditTablesMap(ctx, root.VRW(), root.NodeStore(), []storage.TableEdit{{Name: tName, Ref: &ref}})
932 if err != nil {
933 return nil, err
934 }
935
936 return root.withStorage(newStorage), nil
937}
938
939// withStorage returns a new root value with the given storage.
940func (root *RootValue) withStorage(st storage.RootStorage) *RootValue {

Callers 2

PutTableMethod · 0.95
SetTableHashMethod · 0.95

Calls 4

VRWMethod · 0.95
NodeStoreMethod · 0.95
withStorageMethod · 0.95
EditTablesMapMethod · 0.80

Tested by

no test coverage detected