LoadSequences loads the sequences collection from the given root.
(ctx context.Context, root objinterface.RootValue)
| 132 | |
| 133 | // LoadSequences loads the sequences collection from the given root. |
| 134 | func LoadSequences(ctx context.Context, root objinterface.RootValue) (*Collection, error) { |
| 135 | m, ok, err := storage.GetProllyMap(ctx, root) |
| 136 | if err != nil { |
| 137 | return nil, err |
| 138 | } |
| 139 | if !ok { |
| 140 | m, err = prolly.NewEmptyAddressMap(root.NodeStore()) |
| 141 | if err != nil { |
| 142 | return nil, err |
| 143 | } |
| 144 | } |
| 145 | return &Collection{ |
| 146 | accessedMap: make(map[id.Sequence]*Sequence), |
| 147 | underlyingMap: m, |
| 148 | ns: root.NodeStore(), |
| 149 | }, nil |
| 150 | } |
| 151 | |
| 152 | // ResolveNameFromObjects implements the interface objinterface.Collection. |
| 153 | func (*Collection) ResolveNameFromObjects(ctx context.Context, name doltdb.TableName, rootObjects []objinterface.RootObject) (doltdb.TableName, id.Id, error) { |
no test coverage detected