tinybase 8.6.0-beta.0 → 9.0.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.
Files changed (253) hide show
  1. package/@types/_internal/queries/with-schemas/index.d.ts +1 -2
  2. package/@types/_internal/ui/with-schemas/index.d.ts +8 -16
  3. package/@types/mergeable-store/index.d.ts +4 -4
  4. package/@types/mergeable-store/with-schemas/index.d.ts +41 -17
  5. package/@types/persisters/index.d.ts +34 -13
  6. package/@types/persisters/persister-durable-object-sql-storage/index.d.ts +9 -8
  7. package/@types/persisters/persister-durable-object-sql-storage/with-schemas/index.d.ts +10 -10
  8. package/@types/persisters/with-schemas/index.d.ts +72 -30
  9. package/@types/queries/index.d.ts +5 -7
  10. package/@types/queries/with-schemas/index.d.ts +9 -15
  11. package/@types/store/index.d.ts +1 -2
  12. package/@types/store/with-schemas/index.d.ts +19 -29
  13. package/@types/synchronizers/synchronizer-ws-client/index.d.ts +9 -3
  14. package/@types/synchronizers/synchronizer-ws-client/with-schemas/index.d.ts +10 -3
  15. package/@types/synchronizers/synchronizer-ws-server/index.d.ts +15 -2
  16. package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +17 -2
  17. package/@types/synchronizers/synchronizer-ws-server-durable-object/index.d.ts +51 -0
  18. package/@types/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.d.ts +51 -0
  19. package/@types/ui-react/with-schemas/index.d.ts +3 -6
  20. package/@types/ui-react-dom/with-schemas/index.d.ts +6 -12
  21. package/@types/ui-react-dom-charts/with-schemas/index.d.ts +3 -4
  22. package/@types/ui-solid/with-schemas/index.d.ts +4 -8
  23. package/@types/ui-solid-dom/with-schemas/index.d.ts +6 -12
  24. package/@types/ui-svelte-dom/with-schemas/index.d.ts +6 -12
  25. package/index.js +67 -25
  26. package/indexes/index.js +6 -8
  27. package/indexes/with-schemas/index.js +6 -8
  28. package/mergeable-store/index.js +46 -6
  29. package/mergeable-store/with-schemas/index.js +46 -6
  30. package/metrics/index.js +6 -8
  31. package/metrics/with-schemas/index.js +6 -8
  32. package/min/index.js +1 -1
  33. package/min/index.js.gz +0 -0
  34. package/min/mergeable-store/index.js +1 -1
  35. package/min/mergeable-store/index.js.gz +0 -0
  36. package/min/mergeable-store/with-schemas/index.js +1 -1
  37. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  38. package/min/omni/index.js +1 -1
  39. package/min/omni/index.js.gz +0 -0
  40. package/min/omni/with-schemas/index.js +1 -1
  41. package/min/omni/with-schemas/index.js.gz +0 -0
  42. package/min/persisters/index.js +1 -1
  43. package/min/persisters/index.js.gz +0 -0
  44. package/min/persisters/persister-automerge/index.js +1 -1
  45. package/min/persisters/persister-automerge/index.js.gz +0 -0
  46. package/min/persisters/persister-automerge/with-schemas/index.js +1 -1
  47. package/min/persisters/persister-automerge/with-schemas/index.js.gz +0 -0
  48. package/min/persisters/persister-browser/index.js +1 -1
  49. package/min/persisters/persister-browser/index.js.gz +0 -0
  50. package/min/persisters/persister-browser/with-schemas/index.js +1 -1
  51. package/min/persisters/persister-browser/with-schemas/index.js.gz +0 -0
  52. package/min/persisters/persister-cr-sqlite-wasm/index.js +1 -1
  53. package/min/persisters/persister-cr-sqlite-wasm/index.js.gz +0 -0
  54. package/min/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +1 -1
  55. package/min/persisters/persister-cr-sqlite-wasm/with-schemas/index.js.gz +0 -0
  56. package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
  57. package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
  58. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
  59. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
  60. package/min/persisters/persister-durable-object-storage/index.js +1 -1
  61. package/min/persisters/persister-durable-object-storage/index.js.gz +0 -0
  62. package/min/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
  63. package/min/persisters/persister-durable-object-storage/with-schemas/index.js.gz +0 -0
  64. package/min/persisters/persister-electric-sql/index.js +1 -1
  65. package/min/persisters/persister-electric-sql/index.js.gz +0 -0
  66. package/min/persisters/persister-electric-sql/with-schemas/index.js +1 -1
  67. package/min/persisters/persister-electric-sql/with-schemas/index.js.gz +0 -0
  68. package/min/persisters/persister-expo-sqlite/index.js +1 -1
  69. package/min/persisters/persister-expo-sqlite/index.js.gz +0 -0
  70. package/min/persisters/persister-expo-sqlite/with-schemas/index.js +1 -1
  71. package/min/persisters/persister-expo-sqlite/with-schemas/index.js.gz +0 -0
  72. package/min/persisters/persister-file/index.js +1 -1
  73. package/min/persisters/persister-file/index.js.gz +0 -0
  74. package/min/persisters/persister-file/with-schemas/index.js +1 -1
  75. package/min/persisters/persister-file/with-schemas/index.js.gz +0 -0
  76. package/min/persisters/persister-indexed-db/index.js +1 -1
  77. package/min/persisters/persister-indexed-db/index.js.gz +0 -0
  78. package/min/persisters/persister-indexed-db/with-schemas/index.js +1 -1
  79. package/min/persisters/persister-indexed-db/with-schemas/index.js.gz +0 -0
  80. package/min/persisters/persister-libsql/index.js +1 -1
  81. package/min/persisters/persister-libsql/index.js.gz +0 -0
  82. package/min/persisters/persister-libsql/with-schemas/index.js +1 -1
  83. package/min/persisters/persister-libsql/with-schemas/index.js.gz +0 -0
  84. package/min/persisters/persister-partykit-client/index.js +1 -1
  85. package/min/persisters/persister-partykit-client/index.js.gz +0 -0
  86. package/min/persisters/persister-partykit-client/with-schemas/index.js +1 -1
  87. package/min/persisters/persister-partykit-client/with-schemas/index.js.gz +0 -0
  88. package/min/persisters/persister-pglite/index.js +1 -1
  89. package/min/persisters/persister-pglite/index.js.gz +0 -0
  90. package/min/persisters/persister-pglite/with-schemas/index.js +1 -1
  91. package/min/persisters/persister-pglite/with-schemas/index.js.gz +0 -0
  92. package/min/persisters/persister-postgres/index.js +1 -1
  93. package/min/persisters/persister-postgres/index.js.gz +0 -0
  94. package/min/persisters/persister-postgres/with-schemas/index.js +1 -1
  95. package/min/persisters/persister-postgres/with-schemas/index.js.gz +0 -0
  96. package/min/persisters/persister-powersync/index.js +1 -1
  97. package/min/persisters/persister-powersync/index.js.gz +0 -0
  98. package/min/persisters/persister-powersync/with-schemas/index.js +1 -1
  99. package/min/persisters/persister-powersync/with-schemas/index.js.gz +0 -0
  100. package/min/persisters/persister-react-native-mmkv/index.js +1 -1
  101. package/min/persisters/persister-react-native-mmkv/index.js.gz +0 -0
  102. package/min/persisters/persister-react-native-mmkv/with-schemas/index.js +1 -1
  103. package/min/persisters/persister-react-native-mmkv/with-schemas/index.js.gz +0 -0
  104. package/min/persisters/persister-react-native-sqlite/index.js +1 -1
  105. package/min/persisters/persister-react-native-sqlite/index.js.gz +0 -0
  106. package/min/persisters/persister-react-native-sqlite/with-schemas/index.js +1 -1
  107. package/min/persisters/persister-react-native-sqlite/with-schemas/index.js.gz +0 -0
  108. package/min/persisters/persister-remote/index.js +1 -1
  109. package/min/persisters/persister-remote/index.js.gz +0 -0
  110. package/min/persisters/persister-remote/with-schemas/index.js +1 -1
  111. package/min/persisters/persister-remote/with-schemas/index.js.gz +0 -0
  112. package/min/persisters/persister-sqlite-bun/index.js +1 -1
  113. package/min/persisters/persister-sqlite-bun/index.js.gz +0 -0
  114. package/min/persisters/persister-sqlite-bun/with-schemas/index.js +1 -1
  115. package/min/persisters/persister-sqlite-bun/with-schemas/index.js.gz +0 -0
  116. package/min/persisters/persister-sqlite-wasm/index.js +1 -1
  117. package/min/persisters/persister-sqlite-wasm/index.js.gz +0 -0
  118. package/min/persisters/persister-sqlite-wasm/with-schemas/index.js +1 -1
  119. package/min/persisters/persister-sqlite-wasm/with-schemas/index.js.gz +0 -0
  120. package/min/persisters/persister-sqlite3/index.js +1 -1
  121. package/min/persisters/persister-sqlite3/index.js.gz +0 -0
  122. package/min/persisters/persister-sqlite3/with-schemas/index.js +1 -1
  123. package/min/persisters/persister-sqlite3/with-schemas/index.js.gz +0 -0
  124. package/min/persisters/persister-yjs/index.js +1 -1
  125. package/min/persisters/persister-yjs/index.js.gz +0 -0
  126. package/min/persisters/persister-yjs/with-schemas/index.js +1 -1
  127. package/min/persisters/persister-yjs/with-schemas/index.js.gz +0 -0
  128. package/min/persisters/with-schemas/index.js +1 -1
  129. package/min/persisters/with-schemas/index.js.gz +0 -0
  130. package/min/queries/index.js +1 -1
  131. package/min/queries/index.js.gz +0 -0
  132. package/min/queries/with-schemas/index.js +1 -1
  133. package/min/queries/with-schemas/index.js.gz +0 -0
  134. package/min/store/index.js +1 -1
  135. package/min/store/index.js.gz +0 -0
  136. package/min/store/with-schemas/index.js +1 -1
  137. package/min/store/with-schemas/index.js.gz +0 -0
  138. package/min/synchronizers/index.js +1 -1
  139. package/min/synchronizers/index.js.gz +0 -0
  140. package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
  141. package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
  142. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
  143. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
  144. package/min/synchronizers/synchronizer-local/index.js +1 -1
  145. package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  146. package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  147. package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  148. package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  149. package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  150. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  151. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  152. package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
  153. package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
  154. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
  155. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
  156. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
  157. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
  158. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
  159. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
  160. package/min/synchronizers/with-schemas/index.js +1 -1
  161. package/min/synchronizers/with-schemas/index.js.gz +0 -0
  162. package/min/ui-react-inspector/index.js +1 -1
  163. package/min/ui-react-inspector/index.js.gz +0 -0
  164. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  165. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  166. package/min/ui-solid-inspector/index.js +1 -1
  167. package/min/ui-solid-inspector/index.js.gz +0 -0
  168. package/min/ui-solid-inspector/with-schemas/index.js +1 -1
  169. package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
  170. package/min/ui-svelte-inspector/index.js +1 -1
  171. package/min/ui-svelte-inspector/index.js.gz +0 -0
  172. package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
  173. package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
  174. package/min/with-schemas/index.js +1 -1
  175. package/min/with-schemas/index.js.gz +0 -0
  176. package/omni/index.js +364 -155
  177. package/omni/with-schemas/index.js +364 -155
  178. package/package.json +8 -8
  179. package/persisters/index.js +133 -40
  180. package/persisters/persister-automerge/index.js +4 -3
  181. package/persisters/persister-automerge/with-schemas/index.js +4 -3
  182. package/persisters/persister-browser/index.js +4 -3
  183. package/persisters/persister-browser/with-schemas/index.js +4 -3
  184. package/persisters/persister-cr-sqlite-wasm/index.js +133 -40
  185. package/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +133 -40
  186. package/persisters/persister-durable-object-sql-storage/index.js +275 -113
  187. package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +275 -113
  188. package/persisters/persister-durable-object-storage/index.js +4 -3
  189. package/persisters/persister-durable-object-storage/with-schemas/index.js +4 -3
  190. package/persisters/persister-electric-sql/index.js +133 -40
  191. package/persisters/persister-electric-sql/with-schemas/index.js +133 -40
  192. package/persisters/persister-expo-sqlite/index.js +133 -40
  193. package/persisters/persister-expo-sqlite/with-schemas/index.js +133 -40
  194. package/persisters/persister-file/index.js +4 -3
  195. package/persisters/persister-file/with-schemas/index.js +4 -3
  196. package/persisters/persister-indexed-db/index.js +4 -3
  197. package/persisters/persister-indexed-db/with-schemas/index.js +4 -3
  198. package/persisters/persister-libsql/index.js +133 -40
  199. package/persisters/persister-libsql/with-schemas/index.js +133 -40
  200. package/persisters/persister-partykit-client/index.js +4 -3
  201. package/persisters/persister-partykit-client/with-schemas/index.js +4 -3
  202. package/persisters/persister-pglite/index.js +134 -40
  203. package/persisters/persister-pglite/with-schemas/index.js +134 -40
  204. package/persisters/persister-postgres/index.js +134 -40
  205. package/persisters/persister-postgres/with-schemas/index.js +134 -40
  206. package/persisters/persister-powersync/index.js +186 -120
  207. package/persisters/persister-powersync/with-schemas/index.js +186 -120
  208. package/persisters/persister-react-native-mmkv/index.js +4 -3
  209. package/persisters/persister-react-native-mmkv/with-schemas/index.js +4 -3
  210. package/persisters/persister-react-native-sqlite/index.js +133 -40
  211. package/persisters/persister-react-native-sqlite/with-schemas/index.js +133 -40
  212. package/persisters/persister-remote/index.js +4 -3
  213. package/persisters/persister-remote/with-schemas/index.js +4 -3
  214. package/persisters/persister-sqlite-bun/index.js +133 -40
  215. package/persisters/persister-sqlite-bun/with-schemas/index.js +133 -40
  216. package/persisters/persister-sqlite-wasm/index.js +133 -40
  217. package/persisters/persister-sqlite-wasm/with-schemas/index.js +133 -40
  218. package/persisters/persister-sqlite3/index.js +133 -40
  219. package/persisters/persister-sqlite3/with-schemas/index.js +133 -40
  220. package/persisters/persister-yjs/index.js +4 -3
  221. package/persisters/persister-yjs/with-schemas/index.js +4 -3
  222. package/persisters/with-schemas/index.js +133 -40
  223. package/queries/index.js +21 -19
  224. package/queries/with-schemas/index.js +21 -19
  225. package/readme.md +14 -14
  226. package/relationships/index.js +6 -8
  227. package/relationships/with-schemas/index.js +6 -8
  228. package/releases.md +72 -57
  229. package/store/index.js +33 -2
  230. package/store/with-schemas/index.js +33 -2
  231. package/synchronizers/index.js +4 -3
  232. package/synchronizers/synchronizer-broadcast-channel/index.js +4 -3
  233. package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +4 -3
  234. package/synchronizers/synchronizer-local/index.js +4 -3
  235. package/synchronizers/synchronizer-local/with-schemas/index.js +4 -3
  236. package/synchronizers/synchronizer-ws-client/index.js +120 -45
  237. package/synchronizers/synchronizer-ws-client/with-schemas/index.js +120 -45
  238. package/synchronizers/synchronizer-ws-server/index.js +116 -36
  239. package/synchronizers/synchronizer-ws-server/with-schemas/index.js +116 -36
  240. package/synchronizers/synchronizer-ws-server-durable-object/index.js +125 -41
  241. package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +125 -41
  242. package/synchronizers/with-schemas/index.js +4 -3
  243. package/ui-react-inspector/index.js +36 -5
  244. package/ui-react-inspector/with-schemas/index.js +36 -5
  245. package/ui-solid-inspector/index.js +36 -5
  246. package/ui-solid-inspector/with-schemas/index.js +36 -5
  247. package/ui-svelte/index.js +1 -1
  248. package/ui-svelte/with-schemas/index.js +1 -1
  249. package/ui-svelte-dom/index.js +2 -2
  250. package/ui-svelte-dom/with-schemas/index.js +2 -2
  251. package/ui-svelte-inspector/index.js +38 -7
  252. package/ui-svelte-inspector/with-schemas/index.js +38 -7
  253. package/with-schemas/index.js +67 -25
@@ -12,8 +12,7 @@ import type {
12
12
  export type JoinedCellIdOrId<
13
13
  Schema extends OptionalTablesSchema = NoTablesSchema,
14
14
  JoinedTableId extends TableIdFromSchema<Schema> | Id =
15
- | TableIdFromSchema<Schema>
16
- | Id,
15
+ TableIdFromSchema<Schema> | Id,
17
16
  > =
18
17
  JoinedTableId extends TableIdFromSchema<Schema>
19
18
  ? CellIdFromSchema<Schema, JoinedTableId>
@@ -15,33 +15,25 @@ import type {
15
15
  import type {Synchronizer} from '../../../synchronizers/with-schemas/index.d.ts';
16
16
 
17
17
  export type StoreOrStoreId<Schemas extends OptionalSchemas> =
18
- | Store<Schemas>
19
- | Id;
18
+ Store<Schemas> | Id;
20
19
 
21
20
  export type MetricsOrMetricsId<Schemas extends OptionalSchemas> =
22
- | Metrics<Schemas>
23
- | Id;
21
+ Metrics<Schemas> | Id;
24
22
 
25
23
  export type IndexesOrIndexesId<Schemas extends OptionalSchemas> =
26
- | Indexes<Schemas>
27
- | Id;
24
+ Indexes<Schemas> | Id;
28
25
 
29
26
  export type RelationshipsOrRelationshipsId<Schemas extends OptionalSchemas> =
30
- | Relationships<Schemas>
31
- | Id;
27
+ Relationships<Schemas> | Id;
32
28
 
33
29
  export type QueriesOrQueriesId<Schemas extends OptionalSchemas> =
34
- | Queries<Schemas>
35
- | Id;
30
+ Queries<Schemas> | Id;
36
31
 
37
32
  export type CheckpointsOrCheckpointsId<Schemas extends OptionalSchemas> =
38
- | Checkpoints<Schemas>
39
- | Id;
33
+ Checkpoints<Schemas> | Id;
40
34
 
41
35
  export type PersisterOrPersisterId<Schemas extends OptionalSchemas> =
42
- | Persister<Schemas, Persists.StoreOrMergeableStore>
43
- | Id;
36
+ Persister<Schemas, Persists.StoreOrMergeableStore> | Id;
44
37
 
45
38
  export type SynchronizerOrSynchronizerId<Schemas extends OptionalSchemas> =
46
- | Synchronizer<Schemas>
47
- | Id;
39
+ Synchronizer<Schemas> | Id;
@@ -1097,19 +1097,19 @@ export interface MergeableStore extends Store {
1097
1097
  * {
1098
1098
  * fido: [
1099
1099
  * {
1100
- * sold: [false, 'Nn1JUF----2FnHIC', 2603026204],
1100
+ * sold: [false, '', 3177411910],
1101
1101
  * species: ['dog', 'Nn1JUF----1FnHIC', 2817056260],
1102
1102
  * },
1103
1103
  * '',
1104
- * 2859424112,
1104
+ * 3078067457,
1105
1105
  * ],
1106
1106
  * },
1107
1107
  * '',
1108
- * 1640515891,
1108
+ * 1137907280,
1109
1109
  * ],
1110
1110
  * },
1111
1111
  * '',
1112
- * 2077041985,
1112
+ * 401719767,
1113
1113
  * ],
1114
1114
  * [{}, '', 0],
1115
1115
  * ];
@@ -91,12 +91,14 @@ export type ContentHashes = [tablesHash: Hash, valuesHash: Hash];
91
91
  export type TablesStamp<
92
92
  Schema extends OptionalTablesSchema,
93
93
  Hashed extends boolean = false,
94
+ WhenSet extends boolean = false,
94
95
  > = Stamp<
95
96
  {
96
97
  [TableId in TableIdFromSchema<Schema>]?: TableStamp<
97
98
  Schema,
98
99
  TableId,
99
- Hashed
100
+ Hashed,
101
+ WhenSet
100
102
  >;
101
103
  },
102
104
  Hashed
@@ -146,7 +148,8 @@ export type TableStamp<
146
148
  Schema extends OptionalTablesSchema,
147
149
  TableId extends TableIdFromSchema<Schema>,
148
150
  Hashed extends boolean = false,
149
- > = Stamp<{[rowId: Id]: RowStamp<Schema, TableId, Hashed>}, Hashed>;
151
+ WhenSet extends boolean = false,
152
+ > = Stamp<{[rowId: Id]: RowStamp<Schema, TableId, Hashed, WhenSet>}, Hashed>;
150
153
 
151
154
  /**
152
155
  * The RowHashes type is used to quickly compare the content of two sets of Row
@@ -192,13 +195,15 @@ export type RowStamp<
192
195
  Schema extends OptionalTablesSchema,
193
196
  TableId extends TableIdFromSchema<Schema>,
194
197
  Hashed extends boolean = false,
198
+ WhenSet extends boolean = false,
195
199
  > = Stamp<
196
200
  {
197
201
  [CellId in CellIdFromSchema<Schema, TableId>]?: CellStamp<
198
202
  Schema,
199
203
  TableId,
200
204
  CellId,
201
- Hashed
205
+ Hashed,
206
+ WhenSet
202
207
  >;
203
208
  },
204
209
  Hashed
@@ -251,7 +256,13 @@ export type CellStamp<
251
256
  TableId extends TableIdFromSchema<Schema>,
252
257
  CellId extends CellIdFromSchema<Schema, TableId>,
253
258
  Hashed extends boolean = false,
254
- > = Stamp<CellOrUndefined<Schema, TableId, CellId>, Hashed>;
259
+ WhenSet extends boolean = false,
260
+ > = Stamp<
261
+ WhenSet extends true
262
+ ? CellOrUndefined<Schema, TableId, CellId>
263
+ : CellOrUndefined<Schema, TableId, CellId>,
264
+ Hashed
265
+ >;
255
266
 
256
267
  /**
257
268
  * The ValuesStamp type is used as metadata to decide how to merge two different
@@ -274,12 +285,14 @@ export type CellStamp<
274
285
  export type ValuesStamp<
275
286
  Schema extends OptionalValuesSchema,
276
287
  Hashed extends boolean = false,
288
+ WhenSet extends boolean = false,
277
289
  > = Stamp<
278
290
  {
279
291
  [ValueId in ValueIdFromSchema<Schema>]?: ValueStamp<
280
292
  Schema,
281
293
  ValueId,
282
- Hashed
294
+ Hashed,
295
+ WhenSet
283
296
  >;
284
297
  },
285
298
  Hashed
@@ -329,7 +342,13 @@ export type ValueStamp<
329
342
  Schema extends OptionalValuesSchema,
330
343
  ValueId extends ValueIdFromSchema<Schema>,
331
344
  Hashed extends boolean = false,
332
- > = Stamp<ValueOrUndefined<Schema, ValueId>, Hashed>;
345
+ WhenSet extends boolean = false,
346
+ > = Stamp<
347
+ WhenSet extends true
348
+ ? ValueOrUndefined<Schema, ValueId>
349
+ : ValueOrUndefined<Schema, ValueId>,
350
+ Hashed
351
+ >;
333
352
 
334
353
  /**
335
354
  * The MergeableContent type represents the content of a MergeableStore and the
@@ -352,9 +371,12 @@ export type ValueStamp<
352
371
  * @category Mergeable
353
372
  * @since v5.0.0
354
373
  */
355
- export type MergeableContent<Schemas extends OptionalSchemas> = [
356
- mergeableTables: TablesStamp<Schemas[0], true>,
357
- mergeableValues: ValuesStamp<Schemas[1], true>,
374
+ export type MergeableContent<
375
+ Schemas extends OptionalSchemas,
376
+ WhenSet extends boolean = false,
377
+ > = [
378
+ mergeableTables: TablesStamp<Schemas[0], true, WhenSet>,
379
+ mergeableValues: ValuesStamp<Schemas[1], true, WhenSet>,
358
380
  ];
359
381
 
360
382
  /**
@@ -384,9 +406,10 @@ export type MergeableContent<Schemas extends OptionalSchemas> = [
384
406
  export type MergeableChanges<
385
407
  Schemas extends OptionalSchemas,
386
408
  Hashed extends boolean = false,
409
+ WhenSet extends boolean = false,
387
410
  > = [
388
- mergeableTables: TablesStamp<Schemas[0], Hashed>,
389
- mergeableValues: ValuesStamp<Schemas[1], Hashed>,
411
+ mergeableTables: TablesStamp<Schemas[0], Hashed, WhenSet>,
412
+ mergeableValues: ValuesStamp<Schemas[1], Hashed, WhenSet>,
390
413
  isChanges: 1,
391
414
  ];
392
415
 
@@ -1017,7 +1040,7 @@ export interface MergeableStore<
1017
1040
  * @since v5.0.0
1018
1041
  */
1019
1042
  setMergeableContent(
1020
- mergeableContent: MergeableContent<Schemas>,
1043
+ mergeableContent: MergeableContent<Schemas, true>,
1021
1044
  ): MergeableStore<Schemas>;
1022
1045
 
1023
1046
  /**
@@ -1161,7 +1184,8 @@ export interface MergeableStore<
1161
1184
  * @since v5.0.0
1162
1185
  */
1163
1186
  applyMergeableChanges(
1164
- mergeableChanges: MergeableChanges<Schemas> | MergeableContent<Schemas>,
1187
+ mergeableChanges:
1188
+ MergeableChanges<Schemas, false, true> | MergeableContent<Schemas, true>,
1165
1189
  ): MergeableStore<Schemas>;
1166
1190
 
1167
1191
  /**
@@ -1590,19 +1614,19 @@ export interface MergeableStore<
1590
1614
  * {
1591
1615
  * fido: [
1592
1616
  * {
1593
- * sold: [false, 'Nn1JUF----2FnHIC', 2603026204],
1617
+ * sold: [false, '', 3177411910],
1594
1618
  * species: ['dog', 'Nn1JUF----1FnHIC', 2817056260],
1595
1619
  * },
1596
1620
  * '',
1597
- * 2859424112,
1621
+ * 3078067457,
1598
1622
  * ],
1599
1623
  * },
1600
1624
  * '',
1601
- * 1640515891,
1625
+ * 1137907280,
1602
1626
  * ],
1603
1627
  * },
1604
1628
  * '',
1605
- * 2077041985,
1629
+ * 401719767,
1606
1630
  * ],
1607
1631
  * [{}, '', 0],
1608
1632
  * ];
@@ -205,10 +205,10 @@ export type PersistedChanges<
205
205
  * neither are present, the content will be loaded using the Persister's load
206
206
  * method. Prior to v5.0, these parameters were callbacks and the overall type
207
207
  * was non-generic.
208
- * @param content If provided, this is a Content object from the Persister
209
- * that will be used to immediately wholesale update the Store.
210
- * @param changes If provided, this is a Changes object from the Persister
211
- * that will be used to immediately incrementally update the Store. This takes
208
+ * @param content If provided, this is a Content object from the Persister that
209
+ * will be used to immediately wholesale update the Store.
210
+ * @param changes If provided, this is a Changes object from the Persister that
211
+ * will be used to immediately incrementally update the Store. This takes
212
212
  * priority over the content argument above if present.
213
213
  * @category Creation
214
214
  * @since v4.0.0
@@ -801,12 +801,15 @@ export type DpcTabularSave = {
801
801
  * Note that both loading and saving of Values from and to the database are
802
802
  * disabled by default.
803
803
  *
804
+ * The `load` and `save` properties can be set to `true` to persist all Values,
805
+ * or to a DpcTabularValuesIn array to persist just a subset of Value Ids.
806
+ *
804
807
  * The 'Dpc' prefix indicates that this type is used within the
805
808
  * DatabasePersisterConfig type.
806
809
  * @example
807
810
  * When applied to a database Persister, this DatabasePersisterConfig will load
808
- * and save the data of a Store's Values into a database
809
- * table called 'my_tinybase_values'.
811
+ * and save the data of two Store Values into a database table called
812
+ * 'my_tinybase_values'.
810
813
  *
811
814
  * ```js
812
815
  * import type {DatabasePersisterConfig} from 'tinybase';
@@ -814,8 +817,8 @@ export type DpcTabularSave = {
814
817
  * export const databasePersisterConfig: DatabasePersisterConfig = {
815
818
  * mode: 'tabular',
816
819
  * values: {
817
- * load: true,
818
- * save: true,
820
+ * load: ['selectedPet', 'open'],
821
+ * save: ['selectedPet', 'open'],
819
822
  * tableName: 'my_tinybase_values',
820
823
  * },
821
824
  * };
@@ -825,17 +828,19 @@ export type DpcTabularSave = {
825
828
  */
826
829
  export type DpcTabularValues = {
827
830
  /**
828
- * Whether Store Values will be loaded from a database table.
831
+ * Whether Store Values will be loaded from a database table, or the subset of
832
+ * Value Ids that will be loaded.
829
833
  * @category Configuration
830
834
  * @since v4.0.0
831
835
  */
832
- load?: boolean;
836
+ load?: boolean | DpcTabularValuesIn;
833
837
  /**
834
- * Whether Store Values will be saved to a database table.
838
+ * Whether Store Values will be saved to a database table, or the subset of
839
+ * Value Ids that will be saved.
835
840
  * @category Configuration
836
841
  * @since v4.0.0
837
842
  */
838
- save?: boolean;
843
+ save?: boolean | DpcTabularValuesIn;
839
844
  /**
840
845
  * The optional name of the database table from and to which the Store Values
841
846
  * should be loaded or saved, defaulting to `tinybase_values`.
@@ -845,6 +850,21 @@ export type DpcTabularValues = {
845
850
  tableName?: string;
846
851
  };
847
852
 
853
+ /**
854
+ * The DpcTabularValuesIn type describes the subset of Store Values that are
855
+ * persisted by the DpcTabularValues type.
856
+ *
857
+ * When used as the DpcTabularValues `load` or `save` property, only the listed
858
+ * Value Ids will be loaded from or saved to the database table. Unlisted
859
+ * database columns are ignored on load and left untouched on save.
860
+ *
861
+ * The 'Dpc' prefix indicates that this type is used within the
862
+ * DatabasePersisterConfig type.
863
+ * @category Configuration
864
+ * @since v9.0.0
865
+ */
866
+ export type DpcTabularValuesIn = Id[];
867
+
848
868
  /**
849
869
  * A Persister object lets you save and load Store data to and from different
850
870
  * locations, or underlying storage types.
@@ -1740,7 +1760,8 @@ export type DatabaseChangeListener = (tableName: string) => void;
1740
1760
  * `stopListeningToPersisted` has been renamed `delPersisterListener`.
1741
1761
  * @param store The Store to persist.
1742
1762
  * @param getPersisted An asynchronous function which will fetch content from
1743
- * the persistence layer (or `undefined` if not present).
1763
+ * the persistence layer. If it returns `undefined`, the load will use the
1764
+ * provided initial content if present, and otherwise leave the Store unchanged.
1744
1765
  * @param setPersisted An asynchronous function which will send content to the
1745
1766
  * persistence layer. Since v4.0, it receives functions for getting the Store
1746
1767
  * content and information about the changes made during a transaction. Since
@@ -30,10 +30,10 @@ import type {DpcJson, Persister, Persists} from '../index.d.ts';
30
30
  * The DpcFragmented type represents the configuration for fragmented
31
31
  * persistence mode in a DurableObjectSqlStoragePersister.
32
32
  *
33
- * This mode stores each table, row, cell, and value as separate database rows,
34
- * avoiding Cloudflare's 2MB row limit that can be hit with large stores in JSON
35
- * mode. While this creates more database writes, it provides better scalability
36
- * for larger datasets.
33
+ * This mode stores each table's metadata, row data, and values as separate
34
+ * database rows, avoiding Cloudflare's 2MB row limit that can be hit with
35
+ * large stores in JSON mode. While this creates more database writes than JSON
36
+ * mode, it provides better scalability for larger datasets.
37
37
  * @example
38
38
  * This example shows how to configure a DurableObjectSqlStoragePersister to use
39
39
  * fragmented mode with a custom storage prefix.
@@ -220,10 +220,11 @@ export interface DurableObjectSqlStoragePersister extends Persister<Persists.Mer
220
220
  * database row. This is efficient for smaller stores but may hit Cloudflare's
221
221
  * 2MB row limit for very large stores and uses fewer database writes.
222
222
  *
223
- * - **Fragmented Mode**: Stores each table, row, cell, and value as separate
224
- * database rows. Use this mode if you're concerned about hitting Cloudflare's
225
- * 2MB row limit with large stores in JSON mode. This mode creates more
226
- * database writes but avoids row size limitations.
223
+ * - **Fragmented Mode**: Stores each table's metadata, row data, and values as
224
+ * separate database rows. Use this mode if you're concerned about hitting
225
+ * Cloudflare's 2MB row limit with large stores in JSON mode. This mode
226
+ * creates more database writes than JSON mode but avoids row size
227
+ * limitations.
227
228
  *
228
229
  * The third argument is a DatabasePersisterConfig object that configures which
229
230
  * of those modes to use, and settings for each. If the third argument is simply
@@ -38,10 +38,10 @@ import type {
38
38
  * The DpcFragmented type represents the configuration for fragmented
39
39
  * persistence mode in a DurableObjectSqlStoragePersister.
40
40
  *
41
- * This mode stores each table, row, cell, and value as separate database rows,
42
- * avoiding Cloudflare's 2MB row limit that can be hit with large stores in JSON
43
- * mode. While this creates more database writes, it provides better scalability
44
- * for larger datasets.
41
+ * This mode stores each table's metadata, row data, and values as separate
42
+ * database rows, avoiding Cloudflare's 2MB row limit that can be hit with
43
+ * large stores in JSON mode. While this creates more database writes than JSON
44
+ * mode, it provides better scalability for larger datasets.
45
45
  * @example
46
46
  * This example shows how to configure a DurableObjectSqlStoragePersister to use
47
47
  * fragmented mode with a custom storage prefix.
@@ -250,10 +250,11 @@ export interface DurableObjectSqlStoragePersister<
250
250
  * database row. This is efficient for smaller stores but may hit Cloudflare's
251
251
  * 2MB row limit for very large stores and uses fewer database writes.
252
252
  *
253
- * - **Fragmented Mode**: Stores each table, row, cell, and value as separate
254
- * database rows. Use this mode if you're concerned about hitting Cloudflare's
255
- * 2MB row limit with large stores in JSON mode. This mode creates more
256
- * database writes but avoids row size limitations.
253
+ * - **Fragmented Mode**: Stores each table's metadata, row data, and values as
254
+ * separate database rows. Use this mode if you're concerned about hitting
255
+ * Cloudflare's 2MB row limit with large stores in JSON mode. This mode
256
+ * creates more database writes than JSON mode but avoids row size
257
+ * limitations.
257
258
  *
258
259
  * The third argument is a DatabasePersisterConfig object that configures which
259
260
  * of those modes to use, and settings for each. If the third argument is simply
@@ -379,8 +380,7 @@ export function createDurableObjectSqlStoragePersister<
379
380
  store: Store<Schemas> | MergeableStore<Schemas>,
380
381
  sqlStorage: SqlStorage,
381
382
  configOrStoreTableName?:
382
- | DurableObjectSqlDatabasePersisterConfig<Schemas>
383
- | string,
383
+ DurableObjectSqlDatabasePersisterConfig<Schemas> | string,
384
384
  onSqlCommand?: (sql: string, params?: any[]) => void,
385
385
  onIgnoredError?: (error: any) => void,
386
386
  ): DurableObjectSqlStoragePersister<Schemas>;
@@ -55,7 +55,10 @@
55
55
  * @module persisters
56
56
  * @since v1.0.0
57
57
  */
58
- import type {TableIdFromSchema} from '../../_internal/store/with-schemas/index.d.ts';
58
+ import type {
59
+ TableIdFromSchema,
60
+ ValueIdFromSchema,
61
+ } from '../../_internal/store/with-schemas/index.d.ts';
59
62
  import type {
60
63
  MergeableChanges,
61
64
  MergeableContent,
@@ -66,6 +69,7 @@ import type {
66
69
  Content,
67
70
  OptionalSchemas,
68
71
  OptionalTablesSchema,
72
+ OptionalValuesSchema,
69
73
  Store,
70
74
  } from '../../store/with-schemas/index.d.ts';
71
75
  import type {Id} from '../../with-schemas/index.d.ts';
@@ -198,11 +202,12 @@ export type PersistedStore<
198
202
  export type PersistedContent<
199
203
  Schemas extends OptionalSchemas,
200
204
  Persist extends Persists = Persists.StoreOnly,
205
+ WhenSet extends boolean = false,
201
206
  > = Persist extends Persists.StoreOrMergeableStore
202
- ? Content<Schemas> | MergeableContent<Schemas>
207
+ ? Content<Schemas, WhenSet> | MergeableContent<Schemas, WhenSet>
203
208
  : Persist extends Persists.MergeableStoreOnly
204
- ? MergeableContent<Schemas>
205
- : Content<Schemas>;
209
+ ? MergeableContent<Schemas, WhenSet>
210
+ : Content<Schemas, WhenSet>;
206
211
 
207
212
  /**
208
213
  * The PersistedChanges type is a generic representation of changes made to the
@@ -231,10 +236,11 @@ export type PersistedContent<
231
236
  export type PersistedChanges<
232
237
  Schemas extends OptionalSchemas,
233
238
  Persist extends Persists = Persists.StoreOnly,
239
+ WhenSet extends boolean = false,
234
240
  > = Persist extends Persists.StoreOrMergeableStore
235
- ? Changes<Schemas> | MergeableChanges<Schemas>
241
+ ? Changes<Schemas> | MergeableChanges<Schemas, false, WhenSet>
236
242
  : Persist extends Persists.MergeableStoreOnly
237
- ? MergeableChanges<Schemas>
243
+ ? MergeableChanges<Schemas, false, WhenSet>
238
244
  : Changes<Schemas>;
239
245
 
240
246
  /**
@@ -260,10 +266,10 @@ export type PersistedChanges<
260
266
  * neither are present, the content will be loaded using the Persister's load
261
267
  * method. Prior to v5.0, these parameters were callbacks and the overall type
262
268
  * was non-generic.
263
- * @param content If provided, this is a Content object from the Persister
264
- * that will be used to immediately wholesale update the Store.
265
- * @param changes If provided, this is a Changes object from the Persister
266
- * that will be used to immediately incrementally update the Store. This takes
269
+ * @param content If provided, this is a Content object from the Persister that
270
+ * will be used to immediately wholesale update the Store.
271
+ * @param changes If provided, this is a Changes object from the Persister that
272
+ * will be used to immediately incrementally update the Store. This takes
267
273
  * priority over the content argument above if present.
268
274
  * @category Creation
269
275
  * @since v4.0.0
@@ -271,9 +277,10 @@ export type PersistedChanges<
271
277
  export type PersisterListener<
272
278
  Schemas extends OptionalSchemas,
273
279
  Persist extends Persists = Persists.StoreOnly,
280
+ WhenSet extends boolean = false,
274
281
  > = (
275
- content?: PersistedContent<Schemas, Persist>,
276
- changes?: PersistedChanges<Schemas, Persist>,
282
+ content?: PersistedContent<Schemas, Persist, WhenSet>,
283
+ changes?: PersistedChanges<Schemas, Persist, WhenSet>,
277
284
  ) => void;
278
285
 
279
286
  /**
@@ -394,8 +401,7 @@ export type PersisterStats = {
394
401
  * @since v4.0.0
395
402
  */
396
403
  export type DatabasePersisterConfig<Schemas extends OptionalSchemas> =
397
- | DpcJson
398
- | DpcTabular<Schemas[0]>;
404
+ DpcJson | DpcTabular<Schemas[0], Schemas[1]>;
399
405
 
400
406
  /**
401
407
  * The DpcJson type describes the configuration of a database-oriented Persister
@@ -552,7 +558,10 @@ export type DpcJson = {
552
558
  * @category Configuration
553
559
  * @since v4.0.0
554
560
  */
555
- export type DpcTabular<Schema extends OptionalTablesSchema> = {
561
+ export type DpcTabular<
562
+ TablesSchema extends OptionalTablesSchema,
563
+ ValuesSchema extends OptionalValuesSchema = OptionalValuesSchema,
564
+ > = {
556
565
  /**
557
566
  * The mode to be used for persisting the Store to the database, in this case
558
567
  * tabular mapping. See the DpcJson type for the alternative JSON
@@ -573,21 +582,21 @@ export type DpcTabular<Schema extends OptionalTablesSchema> = {
573
582
  * @category Configuration
574
583
  * @since v4.0.0
575
584
  */
576
- load?: DpcTabularLoad<Schema>;
585
+ load?: DpcTabularLoad<TablesSchema>;
577
586
  /**
578
587
  * The settings for how the Store Tables are mapped out to the database
579
588
  * tables when saving.
580
589
  * @category Configuration
581
590
  * @since v4.0.0
582
591
  */
583
- save?: DpcTabularSave<Schema>;
592
+ save?: DpcTabularSave<TablesSchema>;
584
593
  };
585
594
  /**
586
595
  * The settings for how the Store Values are mapped to and from the database.
587
596
  * @category Configuration
588
597
  * @since v4.0.0
589
598
  */
590
- values?: DpcTabularValues;
599
+ values?: DpcTabularValues<ValuesSchema>;
591
600
  /**
592
601
  * How often the Persister should poll the database for any changes made to it
593
602
  * by other clients, defaulting to 1 second.
@@ -876,12 +885,15 @@ export type DpcTabularSave<Schema extends OptionalTablesSchema> = {
876
885
  * Note that both loading and saving of Values from and to the database are
877
886
  * disabled by default.
878
887
  *
888
+ * The `load` and `save` properties can be set to `true` to persist all Values,
889
+ * or to a DpcTabularValuesIn array to persist just a subset of Value Ids.
890
+ *
879
891
  * The 'Dpc' prefix indicates that this type is used within the
880
892
  * DatabasePersisterConfig type.
881
893
  * @example
882
894
  * When applied to a database Persister, this DatabasePersisterConfig will load
883
- * and save the data of a Store's Values into a database
884
- * table called 'my_tinybase_values'.
895
+ * and save the data of two Store Values into a database table called
896
+ * 'my_tinybase_values'.
885
897
  *
886
898
  * ```js
887
899
  * import type {DatabasePersisterConfig} from 'tinybase';
@@ -889,8 +901,8 @@ export type DpcTabularSave<Schema extends OptionalTablesSchema> = {
889
901
  * export const databasePersisterConfig: DatabasePersisterConfig = {
890
902
  * mode: 'tabular',
891
903
  * values: {
892
- * load: true,
893
- * save: true,
904
+ * load: ['selectedPet', 'open'],
905
+ * save: ['selectedPet', 'open'],
894
906
  * tableName: 'my_tinybase_values',
895
907
  * },
896
908
  * };
@@ -898,19 +910,23 @@ export type DpcTabularSave<Schema extends OptionalTablesSchema> = {
898
910
  * @category Configuration
899
911
  * @since v4.0.0
900
912
  */
901
- export type DpcTabularValues = {
913
+ export type DpcTabularValues<
914
+ Schema extends OptionalValuesSchema = OptionalValuesSchema,
915
+ > = {
902
916
  /**
903
- * Whether Store Values will be loaded from a database table.
917
+ * Whether Store Values will be loaded from a database table, or the subset of
918
+ * Value Ids that will be loaded.
904
919
  * @category Configuration
905
920
  * @since v4.0.0
906
921
  */
907
- load?: boolean;
922
+ load?: boolean | DpcTabularValuesIn<Schema>;
908
923
  /**
909
- * Whether Store Values will be saved to a database table.
924
+ * Whether Store Values will be saved to a database table, or the subset of
925
+ * Value Ids that will be saved.
910
926
  * @category Configuration
911
927
  * @since v4.0.0
912
928
  */
913
- save?: boolean;
929
+ save?: boolean | DpcTabularValuesIn<Schema>;
914
930
  /**
915
931
  * The optional name of the database table from and to which the Store Values
916
932
  * should be loaded or saved, defaulting to `tinybase_values`.
@@ -920,6 +936,29 @@ export type DpcTabularValues = {
920
936
  tableName?: string;
921
937
  };
922
938
 
939
+ /**
940
+ * The DpcTabularValuesIn type describes the subset of Store Values that are
941
+ * persisted by the DpcTabularValues type.
942
+ *
943
+ * This has schema-based typing. The following is a simplified representation:
944
+ *
945
+ * ```ts override
946
+ * Id[];
947
+ * ```
948
+ *
949
+ * When used as the DpcTabularValues `load` or `save` property, only the listed
950
+ * Value Ids will be loaded from or saved to the database table. Unlisted
951
+ * database columns are ignored on load and left untouched on save.
952
+ *
953
+ * The 'Dpc' prefix indicates that this type is used within the
954
+ * DatabasePersisterConfig type.
955
+ * @category Configuration
956
+ * @since v9.0.0
957
+ */
958
+ export type DpcTabularValuesIn<
959
+ Schema extends OptionalValuesSchema = OptionalValuesSchema,
960
+ > = ValueIdFromSchema<Schema>[];
961
+
923
962
  /**
924
963
  * A Persister object lets you save and load Store data to and from different
925
964
  * locations, or underlying storage types.
@@ -1880,7 +1919,8 @@ export type DatabaseChangeListener = (tableName: string) => void;
1880
1919
  * `stopListeningToPersisted` has been renamed `delPersisterListener`.
1881
1920
  * @param store The Store to persist.
1882
1921
  * @param getPersisted An asynchronous function which will fetch content from
1883
- * the persistence layer (or `undefined` if not present).
1922
+ * the persistence layer. If it returns `undefined`, the load will use the
1923
+ * provided initial content if present, and otherwise leave the Store unchanged.
1884
1924
  * @param setPersisted An asynchronous function which will send content to the
1885
1925
  * persistence layer. Since v4.0, it receives functions for getting the Store
1886
1926
  * content and information about the changes made during a transaction. Since
@@ -2016,13 +2056,15 @@ export function createCustomPersister<
2016
2056
  Persist extends Persists = Persists.StoreOnly,
2017
2057
  >(
2018
2058
  store: PersistedStore<Schemas, Persist>,
2019
- getPersisted: () => Promise<PersistedContent<Schemas, Persist> | undefined>,
2059
+ getPersisted: () => Promise<
2060
+ PersistedContent<Schemas, Persist, true> | undefined
2061
+ >,
2020
2062
  setPersisted: (
2021
2063
  getContent: () => PersistedContent<Schemas, Persist>,
2022
2064
  changes?: PersistedChanges<Schemas, Persist>,
2023
2065
  ) => Promise<void>,
2024
2066
  addPersisterListener: (
2025
- listener: PersisterListener<Schemas, Persist>,
2067
+ listener: PersisterListener<Schemas, Persist, true>,
2026
2068
  ) => ListenerHandle | Promise<ListenerHandle>,
2027
2069
  delPersisterListener: (
2028
2070
  listenerHandle: ListenerHandle,
@@ -42,13 +42,7 @@ import type {
42
42
  * @since v7.2.0
43
43
  */
44
44
  export type ParamValue =
45
- | string
46
- | number
47
- | boolean
48
- | null
49
- | string[]
50
- | number[]
51
- | boolean[];
45
+ string | number | boolean | null | string[] | number[] | boolean[];
52
46
 
53
47
  /**
54
48
  * The ParamValues type describes an object of param values, keyed by param Id,
@@ -861,6 +855,10 @@ export type Param = (paramId: Id) => ParamValue | undefined;
861
855
  * The Select function is provided to the third `query` parameter of the
862
856
  * setQueryDefinition method. A query definition must call the Select function
863
857
  * at least once, otherwise it will be meaningless and return no data.
858
+ *
859
+ * A Row will only appear in the ResultTable if at least one Select clause
860
+ * produces a defined value for it. If all selected Cells or calculated values
861
+ * resolve to `undefined`, no ResultRow is created for that Row.
864
862
  * @example
865
863
  * This example shows a query that selects two Cells from the main query Table.
866
864
  *