@firtoz/drizzle-indexeddb 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @firtoz/drizzle-indexeddb
2
2
 
3
+ ## 0.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ec365af`](https://github.com/firtoz/fullstack-toolkit/commit/ec365af8c17bcd7efc2b0cf9b3bed5225b853e72) Thanks [@firtoz](https://github.com/firtoz)! - Update dependencies
8
+
9
+ - Updated dependencies [[`ec365af`](https://github.com/firtoz/fullstack-toolkit/commit/ec365af8c17bcd7efc2b0cf9b3bed5225b853e72)]:
10
+ - @firtoz/drizzle-utils@0.3.3
11
+
12
+ ## 0.6.1
13
+
14
+ ### Patch Changes
15
+
16
+ - [`2725815`](https://github.com/firtoz/fullstack-toolkit/commit/27258158dd318b34b44ed77b88b2ac9b2b4b6a3d) Thanks [@firtoz](https://github.com/firtoz)! - Updated @tanstack/db peer dependency to >=0.5.23 for compatibility with latest versions
17
+
18
+ - Updated dependencies [[`2725815`](https://github.com/firtoz/fullstack-toolkit/commit/27258158dd318b34b44ed77b88b2ac9b2b4b6a3d)]:
19
+ - @firtoz/drizzle-utils@0.3.2
20
+
3
21
  ## 0.6.0
4
22
 
5
23
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firtoz/drizzle-indexeddb",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "IndexedDB migrations powered by Drizzle ORM",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
@@ -68,23 +68,23 @@
68
68
  "access": "public"
69
69
  },
70
70
  "peerDependencies": {
71
- "@firtoz/drizzle-utils": ">=0.3.1",
72
- "@tanstack/db": ">=0.5.16",
71
+ "@firtoz/drizzle-utils": ">=0.3.3",
72
+ "@tanstack/db": ">=0.5.25",
73
73
  "drizzle-orm": ">=0.45.1",
74
74
  "drizzle-valibot": ">=0.4.0",
75
- "react": ">=19.2.3",
75
+ "react": ">=19.2.4",
76
76
  "valibot": ">=1.0.0"
77
77
  },
78
78
  "devDependencies": {
79
- "@firtoz/drizzle-utils": "^0.3.1",
80
- "@tanstack/db": "^0.5.16",
81
- "@types/react": "^19.2.7",
79
+ "@firtoz/drizzle-utils": "^0.3.3",
80
+ "@tanstack/db": "^0.5.25",
81
+ "@types/react": "^19.2.13",
82
82
  "drizzle-orm": "^0.45.1",
83
83
  "drizzle-valibot": "^0.4.2",
84
- "react": "^19.2.3",
84
+ "react": "^19.2.4",
85
85
  "valibot": "^1.2.0"
86
86
  },
87
87
  "dependencies": {
88
- "citty": "^0.1.6"
88
+ "citty": "^0.2.0"
89
89
  }
90
90
  }
@@ -352,7 +352,7 @@ export function indexedDBCollectionOptions<const TTable extends Table>(
352
352
 
353
353
  // Create backend-specific implementation
354
354
  const backend: SyncBackend<TTable> = {
355
- initialLoad: async (write) => {
355
+ initialLoad: async () => {
356
356
  const db = config.indexedDBRef.current;
357
357
  if (!db) {
358
358
  throw new Error("Database not ready");
@@ -362,12 +362,9 @@ export function indexedDBCollectionOptions<const TTable extends Table>(
362
362
 
363
363
  const items = await db.getAll<IndexedDBSyncItem>(config.storeName);
364
364
 
365
- for (const item of items) {
366
- write(item as unknown as InferSchemaOutput<SelectSchema<TTable>>);
367
- }
365
+ return items as unknown as InferSchemaOutput<SelectSchema<TTable>>[];
368
366
  },
369
-
370
- loadSubset: async (options, write) => {
367
+ loadSubset: async (options) => {
371
368
  const db = config.indexedDBRef.current;
372
369
  if (!db) {
373
370
  throw new Error("Database not ready");
@@ -462,9 +459,7 @@ export function indexedDBCollectionOptions<const TTable extends Table>(
462
459
  items = items.slice(0, options.limit);
463
460
  }
464
461
 
465
- for (const item of items) {
466
- write(item as unknown as InferSchemaOutput<SelectSchema<TTable>>);
467
- }
462
+ return items as unknown as InferSchemaOutput<SelectSchema<TTable>>[];
468
463
  },
469
464
 
470
465
  handleInsert: async (itemsToInsert) => {
@@ -549,13 +544,15 @@ export function indexedDBCollectionOptions<const TTable extends Table>(
549
544
  // For non-eager sync modes, still discover indexes before marking ready
550
545
  const wrappedBackend: SyncBackend<TTable> = {
551
546
  ...backend,
552
- initialLoad: async (write) => {
547
+ initialLoad: async () => {
553
548
  if (config.syncMode === "eager" || !config.syncMode) {
554
- await backend.initialLoad(write);
555
- } else {
556
- // For non-eager sync modes, still discover indexes but don't load data
557
- await discoverIndexesOnce();
549
+ return await backend.initialLoad();
558
550
  }
551
+
552
+ // For non-eager sync modes, still discover indexes but don't load data
553
+ await discoverIndexesOnce();
554
+
555
+ return [];
559
556
  },
560
557
  };
561
558