Init creates the SQLite app state database and deletes the legacy providers.json.
(ctx context.Context)
| 122 | |
| 123 | // Init creates the SQLite app state database and deletes the legacy providers.json. |
| 124 | func (api ProviderAPI) Init(ctx context.Context) (OperationResult, error) { |
| 125 | if err := api.prepareProviderOperation(); err != nil { |
| 126 | return OperationResult{}, err |
| 127 | } |
| 128 | store := api.store() |
| 129 | if err := store.Init(ctx); err != nil { |
| 130 | return OperationResult{}, err |
| 131 | } |
| 132 | return OperationResult{OK: true, Message: fmt.Sprintf("SQLite app state ready at %s", store.Path()), Path: store.Path()}, nil |
| 133 | } |
| 134 | |
| 135 | // File returns providers in providers.File shape for adapters that still need existing helpers. |
| 136 | func (api ProviderAPI) File(ctx context.Context) (providers.File, error) { |