From baea429757e6aad8ccb65dd3889ae98659c876ee Mon Sep 17 00:00:00 2001 From: Tobias Bora Date: Fri, 14 Jun 2024 02:48:01 +0200 Subject: [PATCH] Allow import with custom name --- addons/dexie-export-import/README.md | 1 + addons/dexie-export-import/src/import.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/dexie-export-import/README.md b/addons/dexie-export-import/README.md index 885719ddf..88bf6bf38 100644 --- a/addons/dexie-export-import/README.md +++ b/addons/dexie-export-import/README.md @@ -115,6 +115,7 @@ export interface StaticImportOptions { chunkSizeBytes?: number; // Default: DEFAULT_KILOBYTES_PER_CHUNK ( 1MB ) filter?: (table: string, value: any, key?: any) => boolean; progressCallback?: (progress: ImportProgress) => boolean; + name?: string; } export interface ImportOptions extends StaticImportOptions { diff --git a/addons/dexie-export-import/src/import.ts b/addons/dexie-export-import/src/import.ts index 2fae19a2d..f69e025ea 100644 --- a/addons/dexie-export-import/src/import.ts +++ b/addons/dexie-export-import/src/import.ts @@ -10,6 +10,7 @@ export interface StaticImportOptions { filter?: (table: string, value: any, key?: any) => boolean; transform?: (table: string, value: any, key?: any) => ({value: any, key?: any}); progressCallback?: (progress: ImportProgress) => boolean; + name?: string; } export interface ImportOptions extends StaticImportOptions { @@ -42,9 +43,9 @@ export async function importDB(exportedData: Blob | JsonStream