LoadFromDb reads schema information from db and stores it in memory
(ctx context.Context)
| 559 | |
| 560 | // LoadFromDb reads schema information from db and stores it in memory |
| 561 | func LoadFromDb(ctx context.Context) error { |
| 562 | // Reset the state because with the introduction of incremental restore, |
| 563 | // it can't be assumed that the state would be empty before loading the |
| 564 | // schema from the DB as we don't do drop all in case of incremental restores. |
| 565 | State().DeleteAll() |
| 566 | if err := loadFromDB(ctx, loadSchema); err != nil { |
| 567 | return err |
| 568 | } |
| 569 | return loadFromDB(ctx, loadType) |
| 570 | } |
| 571 | |
| 572 | const ( |
| 573 | loadSchema int = iota |