tanstack-db-pglite 1.0.3 → 1.0.5
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/dist/drizzle.js +20 -17
- package/package.json +10 -8
package/dist/drizzle.js
CHANGED
|
@@ -68,27 +68,30 @@ export function drizzleCollectionOptions({ startSync = true, ...config }) {
|
|
|
68
68
|
return {
|
|
69
69
|
startSync: true,
|
|
70
70
|
sync: {
|
|
71
|
-
sync:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
sync: (params) => {
|
|
72
|
+
resolveSyncParams(params);
|
|
73
|
+
(async () => {
|
|
74
|
+
try {
|
|
75
|
+
await config.prepare?.();
|
|
76
|
+
params.begin();
|
|
77
|
+
// @ts-expect-error drizzle types
|
|
78
|
+
const dbs = await config.db.select().from(config.table);
|
|
79
|
+
dbs.forEach((db) => {
|
|
80
|
+
params.write({ type: 'insert', value: db });
|
|
81
|
+
});
|
|
82
|
+
params.commit();
|
|
83
|
+
if (config.sync && startSync) {
|
|
84
|
+
await config.sync(await getSyncParams());
|
|
85
|
+
}
|
|
84
86
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
87
|
+
finally {
|
|
88
|
+
params.markReady();
|
|
89
|
+
}
|
|
90
|
+
})();
|
|
89
91
|
},
|
|
90
92
|
},
|
|
91
93
|
gcTime: 0,
|
|
94
|
+
// @ts-expect-error wrong types
|
|
92
95
|
schema: createSelectSchema(config.table),
|
|
93
96
|
getKey: t => t[config.primaryColumn.name],
|
|
94
97
|
onInsert: async (params) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tanstack-db-pglite",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"packageManager": "pnpm@10.
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"packageManager": "pnpm@10.22.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "Valerii Strilets",
|
|
7
7
|
"license": "MIT",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
],
|
|
19
19
|
"main": "dist/index.js",
|
|
20
20
|
"types": "dist/index.d.ts",
|
|
21
|
-
"files": [
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
22
24
|
"scripts": {
|
|
23
25
|
"prepublishOnly": "pnpm build",
|
|
24
26
|
"build": "tsc",
|
|
@@ -26,16 +28,16 @@
|
|
|
26
28
|
"lint:fix": "eslint . --fix"
|
|
27
29
|
},
|
|
28
30
|
"peerDependencies": {
|
|
29
|
-
"@tanstack/db": ">=0.
|
|
31
|
+
"@tanstack/db": ">=0.5.0",
|
|
30
32
|
"drizzle-orm": ">=0.44.0"
|
|
31
33
|
},
|
|
32
34
|
"dependencies": {
|
|
33
35
|
"drizzle-zod": "^0.8.3"
|
|
34
36
|
},
|
|
35
37
|
"devDependencies": {
|
|
36
|
-
"@antfu/eslint-config": "^
|
|
37
|
-
"eslint": "^9.
|
|
38
|
-
"jiti": "^2.
|
|
39
|
-
"typescript": "^5.9.
|
|
38
|
+
"@antfu/eslint-config": "^6.2.0",
|
|
39
|
+
"eslint": "^9.39.1",
|
|
40
|
+
"jiti": "^2.6.1",
|
|
41
|
+
"typescript": "^5.9.3"
|
|
40
42
|
}
|
|
41
43
|
}
|