@firtoz/drizzle-indexeddb 0.6.0 → 0.6.1
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 +9 -0
- package/package.json +7 -7
- package/src/collections/indexeddb-collection.ts +11 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @firtoz/drizzle-indexeddb
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`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
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`2725815`](https://github.com/firtoz/fullstack-toolkit/commit/27258158dd318b34b44ed77b88b2ac9b2b4b6a3d)]:
|
|
10
|
+
- @firtoz/drizzle-utils@0.3.2
|
|
11
|
+
|
|
3
12
|
## 0.6.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firtoz/drizzle-indexeddb",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
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.
|
|
72
|
-
"@tanstack/db": ">=0.5.
|
|
71
|
+
"@firtoz/drizzle-utils": ">=0.3.2",
|
|
72
|
+
"@tanstack/db": ">=0.5.23",
|
|
73
73
|
"drizzle-orm": ">=0.45.1",
|
|
74
74
|
"drizzle-valibot": ">=0.4.0",
|
|
75
75
|
"react": ">=19.2.3",
|
|
76
76
|
"valibot": ">=1.0.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@firtoz/drizzle-utils": "^0.3.
|
|
80
|
-
"@tanstack/db": "^0.5.
|
|
81
|
-
"@types/react": "^19.2.
|
|
79
|
+
"@firtoz/drizzle-utils": "^0.3.2",
|
|
80
|
+
"@tanstack/db": "^0.5.23",
|
|
81
|
+
"@types/react": "^19.2.8",
|
|
82
82
|
"drizzle-orm": "^0.45.1",
|
|
83
83
|
"drizzle-valibot": "^0.4.2",
|
|
84
84
|
"react": "^19.2.3",
|
|
85
85
|
"valibot": "^1.2.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"citty": "^0.
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
547
|
+
initialLoad: async () => {
|
|
553
548
|
if (config.syncMode === "eager" || !config.syncMode) {
|
|
554
|
-
await backend.initialLoad(
|
|
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
|
|