GetAllTableNames implements the interface doltdb.RootValue.
(ctx context.Context, includeRootObjects bool)
| 269 | |
| 270 | // GetAllTableNames implements the interface doltdb.RootValue. |
| 271 | func (root *RootValue) GetAllTableNames(ctx context.Context, includeRootObjects bool) ([]doltdb.TableName, error) { |
| 272 | var names []doltdb.TableName |
| 273 | |
| 274 | existingSchemas, err := root.st.GetSchemas(ctx) |
| 275 | if err != nil { |
| 276 | return nil, err |
| 277 | } |
| 278 | for _, existingSchema := range existingSchemas { |
| 279 | tableMap, err := root.getTableMap(ctx, existingSchema.Name) |
| 280 | if err != nil { |
| 281 | return nil, err |
| 282 | } |
| 283 | |
| 284 | err = tableMap.Iter(ctx, func(name string, _ hash.Hash) (bool, error) { |
| 285 | names = append(names, doltdb.TableName{ |
| 286 | Name: name, |
| 287 | Schema: existingSchema.Name, |
| 288 | }) |
| 289 | return false, nil |
| 290 | }) |
| 291 | if err != nil { |
| 292 | return nil, err |
| 293 | } |
| 294 | } |
| 295 | if includeRootObjects { |
| 296 | colls, err := rootobject.LoadAllCollections(ctx, root) |
| 297 | if err != nil { |
| 298 | return nil, err |
| 299 | } |
| 300 | for _, coll := range colls { |
| 301 | err = coll.IterIDs(ctx, func(identifier id.Id) (stop bool, err error) { |
| 302 | names = append(names, coll.IDToTableName(identifier)) |
| 303 | return false, nil |
| 304 | }) |
| 305 | if err != nil { |
| 306 | return nil, err |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | return names, nil |
| 311 | } |
| 312 | |
| 313 | // GetCollation implements the interface doltdb.RootValue. |
| 314 | func (root *RootValue) GetCollation(ctx context.Context) (schema.Collation, error) { |
no test coverage detected