tinybase 8.4.2 → 8.5.0-beta.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/@types/ui-react-dom/index.d.ts +10 -10
- package/@types/ui-react-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-react-dom-charts/index.d.ts +242 -0
- package/@types/ui-react-dom-charts/with-schemas/index.d.ts +296 -0
- package/@types/ui-react-inspector/index.d.ts +1 -1
- package/@types/ui-react-inspector/with-schemas/index.d.ts +1 -1
- package/@types/ui-solid-dom/index.d.ts +10 -10
- package/@types/ui-solid-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-solid-inspector/index.d.ts +1 -1
- package/@types/ui-solid-inspector/with-schemas/index.d.ts +1 -1
- package/@types/ui-svelte-dom/index.d.ts +10 -10
- package/@types/ui-svelte-dom/with-schemas/index.d.ts +10 -10
- package/@types/ui-svelte-inspector/index.d.ts +1 -1
- package/@types/ui-svelte-inspector/with-schemas/index.d.ts +1 -1
- package/common/index.js +3 -2
- package/common/with-schemas/index.js +3 -2
- package/index.js +5 -3
- package/mergeable-store/index.js +5 -3
- package/mergeable-store/with-schemas/index.js +5 -3
- package/metrics/index.js +1 -1
- package/metrics/with-schemas/index.js +1 -1
- package/min/common/index.js +1 -1
- package/min/common/index.js.gz +0 -0
- package/min/common/with-schemas/index.js +1 -1
- package/min/common/with-schemas/index.js.gz +0 -0
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/mergeable-store/index.js +1 -1
- package/min/mergeable-store/index.js.gz +0 -0
- package/min/mergeable-store/with-schemas/index.js +1 -1
- package/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
- package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
- package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-partykit-server/index.js +1 -1
- package/min/persisters/persister-partykit-server/index.js.gz +0 -0
- package/min/persisters/persister-partykit-server/with-schemas/index.js +1 -1
- package/min/persisters/persister-partykit-server/with-schemas/index.js.gz +0 -0
- package/min/queries/index.js +1 -1
- package/min/queries/index.js.gz +0 -0
- package/min/queries/with-schemas/index.js +1 -1
- package/min/queries/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/index.js +1 -1
- package/min/synchronizers/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/index.js +1 -1
- package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/with-schemas/index.js +1 -1
- package/min/synchronizers/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom/index.js +1 -1
- package/min/ui-react-dom/index.js.gz +0 -0
- package/min/ui-react-dom/with-schemas/index.js +1 -1
- package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom-charts/index.js +1 -0
- package/min/ui-react-dom-charts/index.js.gz +0 -0
- package/min/ui-react-dom-charts/with-schemas/index.js +1 -0
- package/min/ui-react-dom-charts/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-dom/index.js +1 -1
- package/min/ui-solid-dom/index.js.gz +0 -0
- package/min/ui-solid-dom/with-schemas/index.js +1 -1
- package/min/ui-solid-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-inspector/index.js +1 -1
- package/min/ui-solid-inspector/index.js.gz +0 -0
- package/min/ui-solid-inspector/with-schemas/index.js +1 -1
- package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-dom/index.js +1 -1
- package/min/ui-svelte-dom/index.js.gz +0 -0
- package/min/ui-svelte-dom/with-schemas/index.js +1 -1
- package/min/ui-svelte-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-inspector/index.js +1 -1
- package/min/ui-svelte-inspector/index.js.gz +0 -0
- package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
- package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
- package/min/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/omni/index.js +7 -4
- package/omni/with-schemas/index.js +7 -4
- package/package.json +38 -2
- package/persisters/persister-durable-object-sql-storage/index.js +13 -11
- package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +13 -11
- package/persisters/persister-partykit-client/index.js +2 -1
- package/persisters/persister-partykit-client/with-schemas/index.js +2 -1
- package/persisters/persister-partykit-server/index.js +2 -1
- package/persisters/persister-partykit-server/with-schemas/index.js +2 -1
- package/queries/index.js +1 -1
- package/queries/with-schemas/index.js +1 -1
- package/readme.md +18 -14
- package/releases.md +91 -58
- package/synchronizers/index.js +3 -2
- package/synchronizers/synchronizer-broadcast-channel/index.js +3 -2
- package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-local/index.js +3 -2
- package/synchronizers/synchronizer-local/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-client/index.js +3 -2
- package/synchronizers/synchronizer-ws-client/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-server/index.js +3 -2
- package/synchronizers/synchronizer-ws-server/with-schemas/index.js +3 -2
- package/synchronizers/synchronizer-ws-server-durable-object/index.js +3 -2
- package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +3 -2
- package/synchronizers/with-schemas/index.js +3 -2
- package/ui-react-dom/index.js +10 -7
- package/ui-react-dom/with-schemas/index.js +10 -7
- package/ui-react-dom-charts/index.js +1229 -0
- package/ui-react-dom-charts/with-schemas/index.js +1229 -0
- package/ui-react-inspector/index.js +13 -9
- package/ui-react-inspector/with-schemas/index.js +13 -9
- package/ui-solid-dom/index.js +10 -7
- package/ui-solid-dom/with-schemas/index.js +10 -7
- package/ui-solid-inspector/index.js +13 -9
- package/ui-solid-inspector/with-schemas/index.js +13 -9
- package/ui-svelte-dom/index.js +11 -8
- package/ui-svelte-dom/with-schemas/index.js +11 -8
- package/ui-svelte-inspector/index.js +17 -13
- package/ui-svelte-inspector/with-schemas/index.js +17 -13
- package/with-schemas/index.js +5 -3
package/omni/index.js
CHANGED
|
@@ -63,6 +63,7 @@ const strReplace = (str, searchValue, replaceValue) =>
|
|
|
63
63
|
str.replace(searchValue, replaceValue);
|
|
64
64
|
|
|
65
65
|
const promise = Promise;
|
|
66
|
+
const math = Math;
|
|
66
67
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
67
68
|
predicate(value)
|
|
68
69
|
? /* istanbul ignore next */
|
|
@@ -71,16 +72,17 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
|
71
72
|
const GLOBAL = globalThis;
|
|
72
73
|
const WINDOW = GLOBAL.window;
|
|
73
74
|
const THOUSAND = 1e3;
|
|
75
|
+
const string = String;
|
|
74
76
|
const startInterval = (callback, sec, immediate) => {
|
|
75
77
|
return setInterval(callback, sec * THOUSAND);
|
|
76
78
|
};
|
|
77
79
|
const stopInterval = clearInterval;
|
|
78
80
|
const startTimeout = (callback, sec = 0) =>
|
|
79
81
|
setTimeout(callback, sec * THOUSAND);
|
|
80
|
-
const math = Math;
|
|
81
82
|
const mathMax = math.max;
|
|
82
83
|
const mathMin = math.min;
|
|
83
84
|
const mathFloor = math.floor;
|
|
85
|
+
const mathRandom = math.random;
|
|
84
86
|
const isFiniteNumber = isFinite;
|
|
85
87
|
const isInstanceOf = (thing, cls) => thing instanceof cls;
|
|
86
88
|
const isNullish = (thing) => thing == null;
|
|
@@ -92,6 +94,7 @@ const ifNotNullish = getIfNotFunction(isNullish);
|
|
|
92
94
|
const ifNotUndefined = getIfNotFunction(isUndefined);
|
|
93
95
|
const isTypeStringOrBoolean = (type) => type == STRING || type == BOOLEAN;
|
|
94
96
|
const isString = (thing) => getTypeOf(thing) == STRING;
|
|
97
|
+
const isNumber = (thing) => getTypeOf(thing) == NUMBER;
|
|
95
98
|
const isFunction = (thing) => getTypeOf(thing) == FUNCTION$1;
|
|
96
99
|
const isArray = (thing) => Array.isArray(thing);
|
|
97
100
|
const slice = (arrayOrString, start, end) => arrayOrString.slice(start, end);
|
|
@@ -823,7 +826,7 @@ const decode = (str, pos) => mapGet(DECODE, str[pos]) ?? 0;
|
|
|
823
826
|
const getRandomValues = GLOBAL.crypto
|
|
824
827
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
825
828
|
: /* istanbul ignore next */
|
|
826
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
829
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
827
830
|
const getUniqueId = (length = 16) =>
|
|
828
831
|
arrayReduce(
|
|
829
832
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -1242,7 +1245,7 @@ const stampValidate = (stamp, validateThing) =>
|
|
|
1242
1245
|
isArray(stamp) &&
|
|
1243
1246
|
size(stamp) == 3 &&
|
|
1244
1247
|
isString(stamp[1]) &&
|
|
1245
|
-
|
|
1248
|
+
isNumber(stamp[2]) &&
|
|
1246
1249
|
isFiniteNumber(stamp[2]) &&
|
|
1247
1250
|
validateThing(stamp[0]);
|
|
1248
1251
|
|
|
@@ -5457,7 +5460,7 @@ const deconstruct = (prefix, message, stringified) => {
|
|
|
5457
5460
|
return strStartsWith(message, prefix)
|
|
5458
5461
|
? [
|
|
5459
5462
|
message[prefixSize],
|
|
5460
|
-
(stringified ? jsonParseWithUndefined :
|
|
5463
|
+
(stringified ? jsonParseWithUndefined : string)(
|
|
5461
5464
|
slice(message, prefixSize + 1),
|
|
5462
5465
|
),
|
|
5463
5466
|
]
|
|
@@ -63,6 +63,7 @@ const strReplace = (str, searchValue, replaceValue) =>
|
|
|
63
63
|
str.replace(searchValue, replaceValue);
|
|
64
64
|
|
|
65
65
|
const promise = Promise;
|
|
66
|
+
const math = Math;
|
|
66
67
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
67
68
|
predicate(value)
|
|
68
69
|
? /* istanbul ignore next */
|
|
@@ -71,16 +72,17 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
|
71
72
|
const GLOBAL = globalThis;
|
|
72
73
|
const WINDOW = GLOBAL.window;
|
|
73
74
|
const THOUSAND = 1e3;
|
|
75
|
+
const string = String;
|
|
74
76
|
const startInterval = (callback, sec, immediate) => {
|
|
75
77
|
return setInterval(callback, sec * THOUSAND);
|
|
76
78
|
};
|
|
77
79
|
const stopInterval = clearInterval;
|
|
78
80
|
const startTimeout = (callback, sec = 0) =>
|
|
79
81
|
setTimeout(callback, sec * THOUSAND);
|
|
80
|
-
const math = Math;
|
|
81
82
|
const mathMax = math.max;
|
|
82
83
|
const mathMin = math.min;
|
|
83
84
|
const mathFloor = math.floor;
|
|
85
|
+
const mathRandom = math.random;
|
|
84
86
|
const isFiniteNumber = isFinite;
|
|
85
87
|
const isInstanceOf = (thing, cls) => thing instanceof cls;
|
|
86
88
|
const isNullish = (thing) => thing == null;
|
|
@@ -92,6 +94,7 @@ const ifNotNullish = getIfNotFunction(isNullish);
|
|
|
92
94
|
const ifNotUndefined = getIfNotFunction(isUndefined);
|
|
93
95
|
const isTypeStringOrBoolean = (type) => type == STRING || type == BOOLEAN;
|
|
94
96
|
const isString = (thing) => getTypeOf(thing) == STRING;
|
|
97
|
+
const isNumber = (thing) => getTypeOf(thing) == NUMBER;
|
|
95
98
|
const isFunction = (thing) => getTypeOf(thing) == FUNCTION$1;
|
|
96
99
|
const isArray = (thing) => Array.isArray(thing);
|
|
97
100
|
const slice = (arrayOrString, start, end) => arrayOrString.slice(start, end);
|
|
@@ -823,7 +826,7 @@ const decode = (str, pos) => mapGet(DECODE, str[pos]) ?? 0;
|
|
|
823
826
|
const getRandomValues = GLOBAL.crypto
|
|
824
827
|
? (array) => GLOBAL.crypto.getRandomValues(array)
|
|
825
828
|
: /* istanbul ignore next */
|
|
826
|
-
(array) => arrayMap(array, () => mathFloor(
|
|
829
|
+
(array) => arrayMap(array, () => mathFloor(mathRandom() * 256));
|
|
827
830
|
const getUniqueId = (length = 16) =>
|
|
828
831
|
arrayReduce(
|
|
829
832
|
getRandomValues(new Uint8Array(length)),
|
|
@@ -1242,7 +1245,7 @@ const stampValidate = (stamp, validateThing) =>
|
|
|
1242
1245
|
isArray(stamp) &&
|
|
1243
1246
|
size(stamp) == 3 &&
|
|
1244
1247
|
isString(stamp[1]) &&
|
|
1245
|
-
|
|
1248
|
+
isNumber(stamp[2]) &&
|
|
1246
1249
|
isFiniteNumber(stamp[2]) &&
|
|
1247
1250
|
validateThing(stamp[0]);
|
|
1248
1251
|
|
|
@@ -5457,7 +5460,7 @@ const deconstruct = (prefix, message, stringified) => {
|
|
|
5457
5460
|
return strStartsWith(message, prefix)
|
|
5458
5461
|
? [
|
|
5459
5462
|
message[prefixSize],
|
|
5460
|
-
(stringified ? jsonParseWithUndefined :
|
|
5463
|
+
(stringified ? jsonParseWithUndefined : string)(
|
|
5461
5464
|
slice(message, prefixSize + 1),
|
|
5462
5465
|
),
|
|
5463
5466
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0-beta.1",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"effect": "^3.21.2",
|
|
37
37
|
"electric-sql": "^0.12.1",
|
|
38
38
|
"expo": "^56.0.8",
|
|
39
|
-
"expo-sqlite": "^
|
|
39
|
+
"expo-sqlite": "^56.0.4",
|
|
40
40
|
"partykit": "^0.0.115",
|
|
41
41
|
"partysocket": "^1.1.19",
|
|
42
42
|
"postgres": "^3.4.9",
|
|
@@ -436,6 +436,12 @@
|
|
|
436
436
|
"ui-react-dom/with-schemas": [
|
|
437
437
|
"./@types/ui-react-dom/with-schemas/index.d.ts"
|
|
438
438
|
],
|
|
439
|
+
"ui-react-dom-charts": [
|
|
440
|
+
"./@types/ui-react-dom-charts/index.d.ts"
|
|
441
|
+
],
|
|
442
|
+
"ui-react-dom-charts/with-schemas": [
|
|
443
|
+
"./@types/ui-react-dom-charts/with-schemas/index.d.ts"
|
|
444
|
+
],
|
|
439
445
|
"ui-react-inspector": [
|
|
440
446
|
"./@types/ui-react-inspector/index.d.ts"
|
|
441
447
|
],
|
|
@@ -778,6 +784,12 @@
|
|
|
778
784
|
"min/ui-react-dom/with-schemas": [
|
|
779
785
|
"./@types/ui-react-dom/with-schemas/index.d.ts"
|
|
780
786
|
],
|
|
787
|
+
"min/ui-react-dom-charts": [
|
|
788
|
+
"./@types/ui-react-dom-charts/index.d.ts"
|
|
789
|
+
],
|
|
790
|
+
"min/ui-react-dom-charts/with-schemas": [
|
|
791
|
+
"./@types/ui-react-dom-charts/with-schemas/index.d.ts"
|
|
792
|
+
],
|
|
781
793
|
"min/ui-react-inspector": [
|
|
782
794
|
"./@types/ui-react-inspector/index.d.ts"
|
|
783
795
|
],
|
|
@@ -1417,6 +1429,18 @@
|
|
|
1417
1429
|
"default": "./ui-react-dom/index.js"
|
|
1418
1430
|
}
|
|
1419
1431
|
},
|
|
1432
|
+
"./ui-react-dom-charts": {
|
|
1433
|
+
"default": {
|
|
1434
|
+
"types": "./@types/ui-react-dom-charts/index.d.ts",
|
|
1435
|
+
"default": "./ui-react-dom-charts/index.js"
|
|
1436
|
+
}
|
|
1437
|
+
},
|
|
1438
|
+
"./ui-react-dom-charts/with-schemas": {
|
|
1439
|
+
"default": {
|
|
1440
|
+
"types": "./@types/ui-react-dom-charts/with-schemas/index.d.ts",
|
|
1441
|
+
"default": "./ui-react-dom-charts/index.js"
|
|
1442
|
+
}
|
|
1443
|
+
},
|
|
1420
1444
|
"./ui-react-inspector": {
|
|
1421
1445
|
"default": {
|
|
1422
1446
|
"types": "./@types/ui-react-inspector/index.d.ts",
|
|
@@ -2101,6 +2125,18 @@
|
|
|
2101
2125
|
"default": "./min/ui-react-dom/index.js"
|
|
2102
2126
|
}
|
|
2103
2127
|
},
|
|
2128
|
+
"./min/ui-react-dom-charts": {
|
|
2129
|
+
"default": {
|
|
2130
|
+
"types": "./@types/ui-react-dom-charts/index.d.ts",
|
|
2131
|
+
"default": "./min/ui-react-dom-charts/index.js"
|
|
2132
|
+
}
|
|
2133
|
+
},
|
|
2134
|
+
"./min/ui-react-dom-charts/with-schemas": {
|
|
2135
|
+
"default": {
|
|
2136
|
+
"types": "./@types/ui-react-dom-charts/with-schemas/index.d.ts",
|
|
2137
|
+
"default": "./min/ui-react-dom-charts/index.js"
|
|
2138
|
+
}
|
|
2139
|
+
},
|
|
2104
2140
|
"./min/ui-react-inspector": {
|
|
2105
2141
|
"default": {
|
|
2106
2142
|
"types": "./@types/ui-react-inspector/index.d.ts",
|
|
@@ -19,6 +19,8 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
|
19
19
|
otherwise?.()
|
|
20
20
|
: then(value);
|
|
21
21
|
const THOUSAND = 1e3;
|
|
22
|
+
const number = Number;
|
|
23
|
+
const string = String;
|
|
22
24
|
const startInterval = (callback, sec, immediate) => {
|
|
23
25
|
return setInterval(callback, sec * THOUSAND);
|
|
24
26
|
};
|
|
@@ -1291,13 +1293,13 @@ const createDurableObjectFragmentedSqlStoragePersister = (
|
|
|
1291
1293
|
const values = stampNewObjectWithHash();
|
|
1292
1294
|
const tablesResult = sqlStorage.exec(`SELECT * FROM ${tablesTable}`);
|
|
1293
1295
|
for (const row of tablesResult.toArray()) {
|
|
1294
|
-
const type =
|
|
1295
|
-
const table_id = row.table_id ?
|
|
1296
|
-
const row_id = row.row_id ?
|
|
1297
|
-
const cell_id = row.cell_id ?
|
|
1298
|
-
const value_data =
|
|
1299
|
-
const timestamp =
|
|
1300
|
-
const hash =
|
|
1296
|
+
const type = string(row.type);
|
|
1297
|
+
const table_id = row.table_id ? string(row.table_id) : null;
|
|
1298
|
+
const row_id = row.row_id ? string(row.row_id) : null;
|
|
1299
|
+
const cell_id = row.cell_id ? string(row.cell_id) : null;
|
|
1300
|
+
const value_data = string(row.value_data);
|
|
1301
|
+
const timestamp = string(row.timestamp);
|
|
1302
|
+
const hash = number(row.hash);
|
|
1301
1303
|
const [zeroOrCellOrValue] = JSON.parse(value_data);
|
|
1302
1304
|
if (type === T) {
|
|
1303
1305
|
if (table_id && row_id && cell_id) {
|
|
@@ -1318,10 +1320,10 @@ const createDurableObjectFragmentedSqlStoragePersister = (
|
|
|
1318
1320
|
}
|
|
1319
1321
|
const valuesResult = sqlStorage.exec(`SELECT * FROM ${valuesTable}`);
|
|
1320
1322
|
for (const row of valuesResult.toArray()) {
|
|
1321
|
-
const value_id = row.value_id ?
|
|
1322
|
-
const value_data =
|
|
1323
|
-
const timestamp =
|
|
1324
|
-
const hash =
|
|
1323
|
+
const value_id = row.value_id ? string(row.value_id) : null;
|
|
1324
|
+
const value_data = string(row.value_data);
|
|
1325
|
+
const timestamp = string(row.timestamp);
|
|
1326
|
+
const hash = number(row.hash);
|
|
1325
1327
|
const [zeroOrCellOrValue] = JSON.parse(value_data);
|
|
1326
1328
|
if (value_id) {
|
|
1327
1329
|
values[0][value_id] = [zeroOrCellOrValue, timestamp, hash];
|
|
@@ -19,6 +19,8 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
|
19
19
|
otherwise?.()
|
|
20
20
|
: then(value);
|
|
21
21
|
const THOUSAND = 1e3;
|
|
22
|
+
const number = Number;
|
|
23
|
+
const string = String;
|
|
22
24
|
const startInterval = (callback, sec, immediate) => {
|
|
23
25
|
return setInterval(callback, sec * THOUSAND);
|
|
24
26
|
};
|
|
@@ -1291,13 +1293,13 @@ const createDurableObjectFragmentedSqlStoragePersister = (
|
|
|
1291
1293
|
const values = stampNewObjectWithHash();
|
|
1292
1294
|
const tablesResult = sqlStorage.exec(`SELECT * FROM ${tablesTable}`);
|
|
1293
1295
|
for (const row of tablesResult.toArray()) {
|
|
1294
|
-
const type =
|
|
1295
|
-
const table_id = row.table_id ?
|
|
1296
|
-
const row_id = row.row_id ?
|
|
1297
|
-
const cell_id = row.cell_id ?
|
|
1298
|
-
const value_data =
|
|
1299
|
-
const timestamp =
|
|
1300
|
-
const hash =
|
|
1296
|
+
const type = string(row.type);
|
|
1297
|
+
const table_id = row.table_id ? string(row.table_id) : null;
|
|
1298
|
+
const row_id = row.row_id ? string(row.row_id) : null;
|
|
1299
|
+
const cell_id = row.cell_id ? string(row.cell_id) : null;
|
|
1300
|
+
const value_data = string(row.value_data);
|
|
1301
|
+
const timestamp = string(row.timestamp);
|
|
1302
|
+
const hash = number(row.hash);
|
|
1301
1303
|
const [zeroOrCellOrValue] = JSON.parse(value_data);
|
|
1302
1304
|
if (type === T) {
|
|
1303
1305
|
if (table_id && row_id && cell_id) {
|
|
@@ -1318,10 +1320,10 @@ const createDurableObjectFragmentedSqlStoragePersister = (
|
|
|
1318
1320
|
}
|
|
1319
1321
|
const valuesResult = sqlStorage.exec(`SELECT * FROM ${valuesTable}`);
|
|
1320
1322
|
for (const row of valuesResult.toArray()) {
|
|
1321
|
-
const value_id = row.value_id ?
|
|
1322
|
-
const value_data =
|
|
1323
|
-
const timestamp =
|
|
1324
|
-
const hash =
|
|
1323
|
+
const value_id = row.value_id ? string(row.value_id) : null;
|
|
1324
|
+
const value_data = string(row.value_data);
|
|
1325
|
+
const timestamp = string(row.timestamp);
|
|
1326
|
+
const hash = number(row.hash);
|
|
1325
1327
|
const [zeroOrCellOrValue] = JSON.parse(value_data);
|
|
1326
1328
|
if (value_id) {
|
|
1327
1329
|
values[0][value_id] = [zeroOrCellOrValue, timestamp, hash];
|
|
@@ -10,6 +10,7 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
|
10
10
|
? /* istanbul ignore next */
|
|
11
11
|
otherwise?.()
|
|
12
12
|
: then(value);
|
|
13
|
+
const string = String;
|
|
13
14
|
const isInstanceOf = (thing, cls) => thing instanceof cls;
|
|
14
15
|
const isNullish = (thing) => thing == null;
|
|
15
16
|
const isUndefined = (thing) => thing === void 0;
|
|
@@ -475,7 +476,7 @@ const deconstruct = (prefix, message, stringified) => {
|
|
|
475
476
|
return strStartsWith(message, prefix)
|
|
476
477
|
? [
|
|
477
478
|
message[prefixSize],
|
|
478
|
-
(stringified ? jsonParseWithUndefined :
|
|
479
|
+
(stringified ? jsonParseWithUndefined : string)(
|
|
479
480
|
slice(message, prefixSize + 1),
|
|
480
481
|
),
|
|
481
482
|
]
|
|
@@ -10,6 +10,7 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
|
10
10
|
? /* istanbul ignore next */
|
|
11
11
|
otherwise?.()
|
|
12
12
|
: then(value);
|
|
13
|
+
const string = String;
|
|
13
14
|
const isInstanceOf = (thing, cls) => thing instanceof cls;
|
|
14
15
|
const isNullish = (thing) => thing == null;
|
|
15
16
|
const isUndefined = (thing) => thing === void 0;
|
|
@@ -475,7 +476,7 @@ const deconstruct = (prefix, message, stringified) => {
|
|
|
475
476
|
return strStartsWith(message, prefix)
|
|
476
477
|
? [
|
|
477
478
|
message[prefixSize],
|
|
478
|
-
(stringified ? jsonParseWithUndefined :
|
|
479
|
+
(stringified ? jsonParseWithUndefined : string)(
|
|
479
480
|
slice(message, prefixSize + 1),
|
|
480
481
|
),
|
|
481
482
|
]
|
|
@@ -12,6 +12,7 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
|
12
12
|
? /* istanbul ignore next */
|
|
13
13
|
otherwise?.()
|
|
14
14
|
: then(value);
|
|
15
|
+
const string = String;
|
|
15
16
|
const isInstanceOf = (thing, cls) => thing instanceof cls;
|
|
16
17
|
const isNullish = (thing) => thing == null;
|
|
17
18
|
const isUndefined = (thing) => thing === void 0;
|
|
@@ -93,7 +94,7 @@ const deconstruct = (prefix, message, stringified) => {
|
|
|
93
94
|
return strStartsWith(message, prefix)
|
|
94
95
|
? [
|
|
95
96
|
message[prefixSize],
|
|
96
|
-
(stringified ? jsonParseWithUndefined :
|
|
97
|
+
(stringified ? jsonParseWithUndefined : string)(
|
|
97
98
|
slice(message, prefixSize + 1),
|
|
98
99
|
),
|
|
99
100
|
]
|
|
@@ -12,6 +12,7 @@ const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
|
12
12
|
? /* istanbul ignore next */
|
|
13
13
|
otherwise?.()
|
|
14
14
|
: then(value);
|
|
15
|
+
const string = String;
|
|
15
16
|
const isInstanceOf = (thing, cls) => thing instanceof cls;
|
|
16
17
|
const isNullish = (thing) => thing == null;
|
|
17
18
|
const isUndefined = (thing) => thing === void 0;
|
|
@@ -93,7 +94,7 @@ const deconstruct = (prefix, message, stringified) => {
|
|
|
93
94
|
return strStartsWith(message, prefix)
|
|
94
95
|
? [
|
|
95
96
|
message[prefixSize],
|
|
96
|
-
(stringified ? jsonParseWithUndefined :
|
|
97
|
+
(stringified ? jsonParseWithUndefined : string)(
|
|
97
98
|
slice(message, prefixSize + 1),
|
|
98
99
|
),
|
|
99
100
|
]
|
package/queries/index.js
CHANGED
|
@@ -24,12 +24,12 @@ const SORTED_ROW_IDS = 'Sorted' + ROW + IDS;
|
|
|
24
24
|
const CELL = 'Cell';
|
|
25
25
|
const CELL_IDS = CELL + IDS;
|
|
26
26
|
|
|
27
|
+
const math = Math;
|
|
27
28
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
28
29
|
predicate(value)
|
|
29
30
|
? /* istanbul ignore next */
|
|
30
31
|
otherwise?.()
|
|
31
32
|
: then(value);
|
|
32
|
-
const math = Math;
|
|
33
33
|
const mathMax = math.max;
|
|
34
34
|
const mathMin = math.min;
|
|
35
35
|
const isFiniteNumber = isFinite;
|
|
@@ -24,12 +24,12 @@ const SORTED_ROW_IDS = 'Sorted' + ROW + IDS;
|
|
|
24
24
|
const CELL = 'Cell';
|
|
25
25
|
const CELL_IDS = CELL + IDS;
|
|
26
26
|
|
|
27
|
+
const math = Math;
|
|
27
28
|
const getIfNotFunction = (predicate) => (value, then, otherwise) =>
|
|
28
29
|
predicate(value)
|
|
29
30
|
? /* istanbul ignore next */
|
|
30
31
|
otherwise?.()
|
|
31
32
|
: then(value);
|
|
32
|
-
const math = Math;
|
|
33
33
|
const mathMax = math.max;
|
|
34
34
|
const mathMin = math.min;
|
|
35
35
|
const isFiniteNumber = isFinite;
|