tinybase 9.7.0-beta.1 → 9.7.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/indexes/index.d.ts +3 -3
- package/@types/indexes/with-schemas/index.d.ts +3 -3
- package/@types/persisters/persister-electric-sql/index.d.ts +12 -0
- package/@types/persisters/persister-electric-sql/with-schemas/index.d.ts +12 -0
- package/@types/persisters/persister-sqlite3/index.d.ts +12 -0
- package/@types/persisters/persister-sqlite3/with-schemas/index.d.ts +12 -0
- 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 +7 -7
- package/@types/ui-react-dom-charts/with-schemas/index.d.ts +7 -7
- 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/agents.md +7 -0
- package/checkpoints/index.js +4 -2
- package/checkpoints/with-schemas/index.js +4 -2
- package/index.js +37 -4
- package/metrics/index.js +2 -1
- package/metrics/with-schemas/index.js +2 -1
- package/min/checkpoints/index.js +1 -1
- package/min/checkpoints/index.js.gz +0 -0
- package/min/checkpoints/with-schemas/index.js +1 -1
- package/min/checkpoints/with-schemas/index.js.gz +0 -0
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/metrics/index.js +1 -1
- package/min/metrics/index.js.gz +0 -0
- package/min/metrics/with-schemas/index.js +1 -1
- package/min/metrics/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/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/relationships/index.js +1 -1
- package/min/relationships/index.js.gz +0 -0
- package/min/relationships/with-schemas/index.js +1 -1
- package/min/relationships/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/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/omni/index.js +38 -5
- package/omni/with-schemas/index.js +38 -5
- package/package.json +5 -5
- package/queries/index.js +2 -1
- package/queries/with-schemas/index.js +2 -1
- package/readme.md +14 -14
- package/relationships/index.js +39 -9
- package/relationships/with-schemas/index.js +39 -9
- package/releases.md +72 -72
- package/synchronizers/synchronizer-local/index.js +1 -1
- package/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/with-schemas/index.js +37 -4
package/with-schemas/index.js
CHANGED
|
@@ -898,7 +898,8 @@ const createCheckpoints = getCreateFunction(
|
|
|
898
898
|
cellOrValueIsEqual(oldNew[0], newCell) &&
|
|
899
899
|
collIsEmpty(mapSet(row, cellId)) &&
|
|
900
900
|
collIsEmpty(mapSet(table, rowId)) &&
|
|
901
|
-
collIsEmpty(mapSet(cellsDelta, tableId))
|
|
901
|
+
collIsEmpty(mapSet(cellsDelta, tableId)) &&
|
|
902
|
+
collIsEmpty(valuesDelta)
|
|
902
903
|
) {
|
|
903
904
|
storeUnchanged();
|
|
904
905
|
}
|
|
@@ -918,7 +919,8 @@ const createCheckpoints = getCreateFunction(
|
|
|
918
919
|
oldNew[1] = newValue;
|
|
919
920
|
if (
|
|
920
921
|
cellOrValueIsEqual(oldNew[0], newValue) &&
|
|
921
|
-
collIsEmpty(mapSet(valuesDelta, valueId))
|
|
922
|
+
collIsEmpty(mapSet(valuesDelta, valueId)) &&
|
|
923
|
+
collIsEmpty(cellsDelta)
|
|
922
924
|
) {
|
|
923
925
|
storeUnchanged();
|
|
924
926
|
}
|
|
@@ -4160,7 +4162,8 @@ const numericAggregators = mapNew([
|
|
|
4160
4162
|
[
|
|
4161
4163
|
(numbers, length) => arraySum(numbers) / length,
|
|
4162
4164
|
(metric, add, length) => metric + (add - metric) / (length + 1),
|
|
4163
|
-
(metric, remove, length) =>
|
|
4165
|
+
(metric, remove, length) =>
|
|
4166
|
+
length > 1 ? metric + (metric - remove) / (length - 1) : void 0,
|
|
4164
4167
|
(metric, add, remove, length) => metric + (add - remove) / length,
|
|
4165
4168
|
],
|
|
4166
4169
|
],
|
|
@@ -5680,11 +5683,21 @@ const createRelationships = getCreateFunction((store) => {
|
|
|
5680
5683
|
remoteTableId,
|
|
5681
5684
|
getRemoteRowId2,
|
|
5682
5685
|
) => {
|
|
5686
|
+
mapForEach(mapGet(linkedRowIdsListeners, relationshipId), (firstRowId) =>
|
|
5687
|
+
getLinkedRowIdsCache(relationshipId, firstRowId),
|
|
5688
|
+
);
|
|
5683
5689
|
mapSet(remoteTableIds, relationshipId, remoteTableId);
|
|
5684
5690
|
setDefinitionAndListen(
|
|
5685
5691
|
relationshipId,
|
|
5686
5692
|
localTableId,
|
|
5687
|
-
(
|
|
5693
|
+
(
|
|
5694
|
+
change,
|
|
5695
|
+
changedRemoteRowIds,
|
|
5696
|
+
_changedSortKeys,
|
|
5697
|
+
_rowValues,
|
|
5698
|
+
_sortKeys,
|
|
5699
|
+
force,
|
|
5700
|
+
) => {
|
|
5688
5701
|
const changedLocalRows = setNew();
|
|
5689
5702
|
const changedRemoteRows = setNew();
|
|
5690
5703
|
const changedLinkedRows = setNew();
|
|
@@ -5729,6 +5742,26 @@ const createRelationships = getCreateFunction((store) => {
|
|
|
5729
5742
|
},
|
|
5730
5743
|
);
|
|
5731
5744
|
change();
|
|
5745
|
+
if (force) {
|
|
5746
|
+
mapForEach(
|
|
5747
|
+
mapGet(linkedRowIdsListeners, relationshipId),
|
|
5748
|
+
(firstRowId) => {
|
|
5749
|
+
const oldLinkedRowIds = getLinkedRowIds(
|
|
5750
|
+
relationshipId,
|
|
5751
|
+
firstRowId,
|
|
5752
|
+
);
|
|
5753
|
+
delLinkedRowIdsCache(relationshipId, firstRowId);
|
|
5754
|
+
if (
|
|
5755
|
+
!arrayIsEqual(
|
|
5756
|
+
oldLinkedRowIds,
|
|
5757
|
+
getLinkedRowIds(relationshipId, firstRowId),
|
|
5758
|
+
)
|
|
5759
|
+
) {
|
|
5760
|
+
setAdd(changedLinkedRows, firstRowId);
|
|
5761
|
+
}
|
|
5762
|
+
},
|
|
5763
|
+
);
|
|
5764
|
+
}
|
|
5732
5765
|
collForEach(changedLocalRows, (localRowId) =>
|
|
5733
5766
|
callListeners(remoteRowIdListeners, [relationshipId, localRowId]),
|
|
5734
5767
|
);
|