| 69 | * For database-level operations (switching accounts, workspaces, deleting databases) |
| 70 | */ |
| 71 | export interface IDatabaseManager { |
| 72 | /** Initialize the persistence layer */ |
| 73 | init(): Promise<void> |
| 74 | /** Set current account (switches account-level storage) */ |
| 75 | setAccount(accountId: string): Promise<void> |
| 76 | /** Set current workspace path (switches workspace-level storage) */ |
| 77 | setWorkspace(workspacePath: string): Promise<void> |
| 78 | /** Synchronize main-process access roots for workspaces */ |
| 79 | syncWorkspaceAccess( |
| 80 | currentWorkspacePath: string | null, |
| 81 | approvedWorkspacePaths: string[] |
| 82 | ): Promise<void> |
| 83 | /** Allow a specific workspace path before it is added to the workspace list */ |
| 84 | approveWorkspacePath(workspacePath: string): Promise<void> |
| 85 | /** Commit the active account/workspace context in one step */ |
| 86 | commitContext(input: ContextCommitInput): Promise<void> |
| 87 | /** Get the active persistence context */ |
| 88 | getActiveContext(): PersistenceContext |
| 89 | /** Flush all queued and tracked writes for the active context */ |
| 90 | flushActiveContext(): Promise<void> |
| 91 | /** Wait for account-scoped writes to finish */ |
| 92 | waitForAccountIdle(accountId: string): Promise<void> |
| 93 | /** Wait for workspace-scoped writes to finish */ |
| 94 | waitForWorkspaceIdle(scope: WorkspaceScope): Promise<void> |
| 95 | } |
no outgoing calls
no test coverage detected