GetForeignKeyCollection implements the interface doltdb.RootValue.
(ctx context.Context)
| 352 | |
| 353 | // GetForeignKeyCollection implements the interface doltdb.RootValue. |
| 354 | func (root *RootValue) GetForeignKeyCollection(ctx context.Context) (*doltdb.ForeignKeyCollection, error) { |
| 355 | if root.fkc == nil { |
| 356 | fkMap, ok, err := root.st.GetForeignKeys(ctx, root.vrw) |
| 357 | if err != nil { |
| 358 | return nil, err |
| 359 | } |
| 360 | if !ok { |
| 361 | return doltdb.NewForeignKeyCollection() |
| 362 | } |
| 363 | |
| 364 | root.fkc, err = doltdb.DeserializeForeignKeys(ctx, root.vrw.Format(), fkMap) |
| 365 | if err != nil { |
| 366 | return nil, err |
| 367 | } |
| 368 | } |
| 369 | return root.fkc.Copy(), nil |
| 370 | } |
| 371 | |
| 372 | // GetRootObject implements the interface doltdb.RootValue. |
| 373 | func (root *RootValue) GetRootObject(ctx context.Context, tName doltdb.TableName) (doltdb.RootObject, bool, error) { |
no test coverage detected