@firtoz/drizzle-indexeddb 4.0.1 → 5.0.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 +26 -0
- package/README.md +9 -1
- package/dist/bin/generate-migrations.d.ts +15 -0
- package/dist/bin/generate-migrations.js +184 -0
- package/dist/bin/generate-migrations.js.map +1 -0
- package/dist/chunk-5KCMKETG.js +212 -0
- package/dist/chunk-5KCMKETG.js.map +1 -0
- package/dist/chunk-7X4EIKN4.js +128 -0
- package/dist/chunk-7X4EIKN4.js.map +1 -0
- package/dist/chunk-CPLA7X66.js +129 -0
- package/dist/chunk-CPLA7X66.js.map +1 -0
- package/dist/chunk-HJFI7QKW.js +28 -0
- package/dist/chunk-HJFI7QKW.js.map +1 -0
- package/dist/chunk-JVUF63L6.js +27 -0
- package/dist/chunk-JVUF63L6.js.map +1 -0
- package/dist/chunk-OSOLYU2M.js +126 -0
- package/dist/chunk-OSOLYU2M.js.map +1 -0
- package/dist/chunk-WMCUJFEC.js +311 -0
- package/dist/chunk-WMCUJFEC.js.map +1 -0
- package/dist/chunk-Y6XE3FVT.js +147 -0
- package/dist/chunk-Y6XE3FVT.js.map +1 -0
- package/dist/collections/drizzle-indexeddb-collection.d.ts +62 -0
- package/dist/collections/drizzle-indexeddb-collection.js +3 -0
- package/dist/collections/drizzle-indexeddb-collection.js.map +1 -0
- package/dist/context/DrizzleIndexedDBProvider.d.ts +35 -0
- package/dist/context/DrizzleIndexedDBProvider.js +7 -0
- package/dist/context/DrizzleIndexedDBProvider.js.map +1 -0
- package/dist/context/useDrizzleIndexedDB.d.ts +17 -0
- package/dist/context/useDrizzleIndexedDB.js +8 -0
- package/dist/context/useDrizzleIndexedDB.js.map +1 -0
- package/dist/function-migrator.d.ts +56 -0
- package/dist/function-migrator.js +5 -0
- package/dist/function-migrator.js.map +1 -0
- package/dist/idb-interceptor.d.ts +68 -0
- package/dist/idb-interceptor.js +3 -0
- package/dist/idb-interceptor.js.map +1 -0
- package/dist/idb-operations.d.ts +13 -0
- package/dist/idb-operations.js +4 -0
- package/dist/idb-operations.js.map +1 -0
- package/dist/idb-types.d.ts +82 -0
- package/dist/idb-types.js +3 -0
- package/dist/idb-types.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/instrumented-idb-database.d.ts +17 -0
- package/dist/instrumented-idb-database.js +4 -0
- package/dist/instrumented-idb-database.js.map +1 -0
- package/dist/native-idb-database.d.ts +9 -0
- package/dist/native-idb-database.js +3 -0
- package/dist/native-idb-database.js.map +1 -0
- package/dist/standalone-collection.d.ts +154 -0
- package/dist/standalone-collection.js +7 -0
- package/dist/standalone-collection.js.map +1 -0
- package/package.json +34 -29
- package/src/collections/drizzle-indexeddb-collection.ts +4 -4
- package/src/context/DrizzleIndexedDBProvider.tsx +1 -1
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
type SyncBackend,
|
|
19
19
|
createSyncFunction,
|
|
20
20
|
createInsertSchemaWithDefaults,
|
|
21
|
-
createGetKeyFunction,
|
|
22
21
|
createCollectionConfig,
|
|
23
22
|
} from "@firtoz/drizzle-utils";
|
|
24
23
|
import { evaluateExpression, type CollectionUtils } from "@firtoz/db-helpers";
|
|
@@ -340,15 +339,16 @@ export function drizzleIndexedDBCollectionOptions<const TTable extends Table>(
|
|
|
340
339
|
},
|
|
341
340
|
};
|
|
342
341
|
|
|
343
|
-
|
|
344
|
-
|
|
342
|
+
const getKey = (
|
|
343
|
+
item: InferSchemaOutput<SelectSchema<TTable>>,
|
|
344
|
+
): IdOf<TTable> => (item as { id: IdOf<TTable> }).id;
|
|
345
345
|
|
|
346
346
|
const baseSyncConfig: BaseSyncConfig<TTable> = {
|
|
347
347
|
table,
|
|
348
348
|
readyPromise: config.readyPromise,
|
|
349
349
|
syncMode: config.syncMode,
|
|
350
350
|
debug: config.debug,
|
|
351
|
-
getSyncPersistKey: (item
|
|
351
|
+
getSyncPersistKey: (item) => String(getKey(item)),
|
|
352
352
|
...(config.deferLocalPersistence !== undefined
|
|
353
353
|
? { deferLocalPersistence: config.deferLocalPersistence }
|
|
354
354
|
: {}),
|
|
@@ -18,7 +18,7 @@ import { getTableName, type Table } from "drizzle-orm";
|
|
|
18
18
|
import {
|
|
19
19
|
drizzleIndexedDBCollectionOptions,
|
|
20
20
|
type DrizzleIndexedDBCollectionConfig,
|
|
21
|
-
} from "
|
|
21
|
+
} from "../collections/drizzle-indexeddb-collection";
|
|
22
22
|
import type { CollectionUtils } from "@firtoz/db-helpers";
|
|
23
23
|
import type {
|
|
24
24
|
IdOf,
|