( dbManager: DatabaseManager, onProgress?: ImportProgressCallback, onCompatibilityError?: (error: DataDirCompatibilityError) => void )
| 154 | // ==================== Incremental import ==================== |
| 155 | |
| 156 | function buildIncrementalDeps( |
| 157 | dbManager: DatabaseManager, |
| 158 | onProgress?: ImportProgressCallback, |
| 159 | onCompatibilityError?: (error: DataDirCompatibilityError) => void |
| 160 | ): IncrementalImportDeps { |
| 161 | return { |
| 162 | openDatabase(sessionId: string, readonly?: boolean) { |
| 163 | try { |
| 164 | return dbManager.openRawSessionDatabase(sessionId, { readonly: readonly ?? false }) |
| 165 | } catch (error) { |
| 166 | if (error instanceof DataDirCompatibilityError) onCompatibilityError?.(error) |
| 167 | throw error |
| 168 | } |
| 169 | }, |
| 170 | onProgress: onProgress ?? (() => {}), |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | export async function incrementalImport( |
| 175 | dbManager: DatabaseManager, |
no outgoing calls
no test coverage detected