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

Method PutForeignKeyCollection

core/rootvalue.go:598–608  ·  view source on GitHub ↗

PutForeignKeyCollection implements the interface doltdb.RootValue.

(ctx context.Context, fkc *doltdb.ForeignKeyCollection)

Source from the content-addressed store, hash-verified

596
597// PutForeignKeyCollection implements the interface doltdb.RootValue.
598func (root *RootValue) PutForeignKeyCollection(ctx context.Context, fkc *doltdb.ForeignKeyCollection) (doltdb.RootValue, error) {
599 value, err := doltdb.SerializeForeignKeys(ctx, root.vrw, fkc)
600 if err != nil {
601 return nil, err
602 }
603 newStorage, err := root.st.SetForeignKeyMap(ctx, root.vrw, value)
604 if err != nil {
605 return nil, err
606 }
607 return root.withStorage(newStorage), nil
608}
609
610// PutRootObject implements the interface doltdb.RootValue.
611func (root *RootValue) PutRootObject(ctx context.Context, tName doltdb.TableName, rootObj doltdb.RootObject) (doltdb.RootValue, error) {

Callers 1

RemoveTablesMethod · 0.80

Calls 2

withStorageMethod · 0.95
SetForeignKeyMapMethod · 0.80

Tested by

no test coverage detected