tinybase 7.0.0-beta.1 → 7.0.0-beta.3

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 (329) hide show
  1. package/@types/common/index.d.ts +1 -1
  2. package/@types/mergeable-store/index.d.ts +2 -1
  3. package/@types/mergeable-store/with-schemas/index.d.ts +5 -3
  4. package/@types/omni/index.d.ts +2 -0
  5. package/@types/omni/with-schemas/index.d.ts +2 -0
  6. package/@types/persisters/index.d.ts +4 -0
  7. package/@types/persisters/persister-automerge/index.d.ts +4 -6
  8. package/@types/persisters/persister-automerge/with-schemas/index.d.ts +7 -8
  9. package/@types/persisters/persister-browser/index.d.ts +97 -6
  10. package/@types/persisters/persister-browser/with-schemas/index.d.ts +113 -6
  11. package/@types/persisters/persister-cr-sqlite-wasm/index.d.ts +4 -0
  12. package/@types/persisters/persister-cr-sqlite-wasm/with-schemas/index.d.ts +7 -2
  13. package/@types/persisters/persister-durable-object-sql-storage/index.d.ts +6 -2
  14. package/@types/persisters/persister-durable-object-sql-storage/with-schemas/index.d.ts +5 -0
  15. package/@types/persisters/persister-durable-object-storage/index.d.ts +1 -2
  16. package/@types/persisters/persister-durable-object-storage/with-schemas/index.d.ts +3 -2
  17. package/@types/persisters/persister-electric-sql/index.d.ts +4 -0
  18. package/@types/persisters/persister-electric-sql/with-schemas/index.d.ts +7 -2
  19. package/@types/persisters/persister-expo-sqlite/index.d.ts +5 -2
  20. package/@types/persisters/persister-expo-sqlite/with-schemas/index.d.ts +7 -2
  21. package/@types/persisters/persister-file/index.d.ts +1 -2
  22. package/@types/persisters/persister-file/with-schemas/index.d.ts +3 -2
  23. package/@types/persisters/persister-indexed-db/with-schemas/index.d.ts +3 -2
  24. package/@types/persisters/persister-libsql/index.d.ts +4 -0
  25. package/@types/persisters/persister-libsql/with-schemas/index.d.ts +7 -2
  26. package/@types/persisters/persister-partykit-client/with-schemas/index.d.ts +3 -2
  27. package/@types/persisters/persister-pglite/index.d.ts +7 -3
  28. package/@types/persisters/persister-pglite/with-schemas/index.d.ts +9 -3
  29. package/@types/persisters/persister-postgres/index.d.ts +5 -2
  30. package/@types/persisters/persister-postgres/with-schemas/index.d.ts +7 -2
  31. package/@types/persisters/persister-powersync/index.d.ts +4 -0
  32. package/@types/persisters/persister-powersync/with-schemas/index.d.ts +7 -2
  33. package/@types/persisters/persister-react-native-mmkv/index.d.ts +117 -0
  34. package/@types/persisters/persister-react-native-mmkv/with-schemas/index.d.ts +133 -0
  35. package/@types/persisters/persister-react-native-sqlite/index.d.ts +184 -0
  36. package/@types/persisters/persister-react-native-sqlite/with-schemas/index.d.ts +207 -0
  37. package/@types/persisters/persister-remote/with-schemas/index.d.ts +3 -2
  38. package/@types/persisters/persister-sqlite-bun/index.d.ts +5 -2
  39. package/@types/persisters/persister-sqlite-bun/with-schemas/index.d.ts +7 -2
  40. package/@types/persisters/persister-sqlite-wasm/index.d.ts +6 -2
  41. package/@types/persisters/persister-sqlite-wasm/with-schemas/index.d.ts +8 -2
  42. package/@types/persisters/persister-sqlite3/index.d.ts +5 -2
  43. package/@types/persisters/persister-sqlite3/with-schemas/index.d.ts +7 -2
  44. package/@types/persisters/persister-yjs/with-schemas/index.d.ts +3 -2
  45. package/@types/persisters/with-schemas/index.d.ts +4 -0
  46. package/@types/queries/index.d.ts +1 -1
  47. package/@types/queries/with-schemas/index.d.ts +4 -8
  48. package/@types/store/index.d.ts +34 -19
  49. package/@types/store/with-schemas/index.d.ts +28 -13
  50. package/@types/synchronizers/index.d.ts +1 -0
  51. package/@types/synchronizers/synchronizer-broadcast-channel/with-schemas/index.d.ts +3 -2
  52. package/@types/synchronizers/synchronizer-local/with-schemas/index.d.ts +3 -2
  53. package/@types/synchronizers/synchronizer-ws-client/index.d.ts +4 -2
  54. package/@types/synchronizers/synchronizer-ws-client/with-schemas/index.d.ts +1 -0
  55. package/@types/synchronizers/synchronizer-ws-server/index.d.ts +7 -7
  56. package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +7 -7
  57. package/@types/synchronizers/synchronizer-ws-server-durable-object/index.d.ts +1 -0
  58. package/@types/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.d.ts +1 -0
  59. package/@types/synchronizers/synchronizer-ws-server-simple/index.d.ts +1 -1
  60. package/@types/synchronizers/synchronizer-ws-server-simple/with-schemas/index.d.ts +1 -1
  61. package/@types/synchronizers/with-schemas/index.d.ts +4 -2
  62. package/@types/ui-react/index.d.ts +6 -1
  63. package/@types/ui-react/with-schemas/index.d.ts +6 -1
  64. package/@types/ui-react-dom/index.d.ts +153 -20
  65. package/@types/ui-react-dom/with-schemas/index.d.ts +72 -20
  66. package/@types/ui-react-inspector/index.d.ts +8 -0
  67. package/@types/ui-react-inspector/with-schemas/index.d.ts +27 -1925
  68. package/agents.md +343 -0
  69. package/checkpoints/index.js +11 -6
  70. package/checkpoints/with-schemas/index.js +11 -6
  71. package/common/index.js +8 -4
  72. package/common/with-schemas/index.js +8 -4
  73. package/index.js +63 -31
  74. package/indexes/index.js +10 -5
  75. package/indexes/with-schemas/index.js +10 -5
  76. package/mergeable-store/index.js +54 -22
  77. package/mergeable-store/with-schemas/index.js +54 -22
  78. package/metrics/index.js +10 -5
  79. package/metrics/with-schemas/index.js +10 -5
  80. package/min/checkpoints/index.js +1 -1
  81. package/min/checkpoints/index.js.gz +0 -0
  82. package/min/checkpoints/with-schemas/index.js +1 -1
  83. package/min/checkpoints/with-schemas/index.js.gz +0 -0
  84. package/min/common/index.js +1 -1
  85. package/min/common/index.js.gz +0 -0
  86. package/min/common/with-schemas/index.js +1 -1
  87. package/min/common/with-schemas/index.js.gz +0 -0
  88. package/min/index.js +1 -1
  89. package/min/index.js.gz +0 -0
  90. package/min/indexes/index.js +1 -1
  91. package/min/indexes/index.js.gz +0 -0
  92. package/min/indexes/with-schemas/index.js +1 -1
  93. package/min/indexes/with-schemas/index.js.gz +0 -0
  94. package/min/mergeable-store/index.js +1 -1
  95. package/min/mergeable-store/index.js.gz +0 -0
  96. package/min/mergeable-store/with-schemas/index.js +1 -1
  97. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  98. package/min/metrics/index.js +1 -1
  99. package/min/metrics/index.js.gz +0 -0
  100. package/min/metrics/with-schemas/index.js +1 -1
  101. package/min/metrics/with-schemas/index.js.gz +0 -0
  102. package/min/omni/index.js +1 -1
  103. package/min/omni/index.js.gz +0 -0
  104. package/min/omni/with-schemas/index.js +1 -1
  105. package/min/omni/with-schemas/index.js.gz +0 -0
  106. package/min/persisters/index.js +1 -1
  107. package/min/persisters/index.js.gz +0 -0
  108. package/min/persisters/persister-automerge/index.js +1 -1
  109. package/min/persisters/persister-automerge/index.js.gz +0 -0
  110. package/min/persisters/persister-automerge/with-schemas/index.js +1 -1
  111. package/min/persisters/persister-automerge/with-schemas/index.js.gz +0 -0
  112. package/min/persisters/persister-browser/index.js +1 -1
  113. package/min/persisters/persister-browser/index.js.gz +0 -0
  114. package/min/persisters/persister-browser/with-schemas/index.js +1 -1
  115. package/min/persisters/persister-browser/with-schemas/index.js.gz +0 -0
  116. package/min/persisters/persister-cr-sqlite-wasm/index.js +1 -1
  117. package/min/persisters/persister-cr-sqlite-wasm/index.js.gz +0 -0
  118. package/min/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +1 -1
  119. package/min/persisters/persister-cr-sqlite-wasm/with-schemas/index.js.gz +0 -0
  120. package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
  121. package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
  122. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
  123. package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
  124. package/min/persisters/persister-durable-object-storage/index.js +1 -1
  125. package/min/persisters/persister-durable-object-storage/index.js.gz +0 -0
  126. package/min/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
  127. package/min/persisters/persister-durable-object-storage/with-schemas/index.js.gz +0 -0
  128. package/min/persisters/persister-electric-sql/index.js +1 -1
  129. package/min/persisters/persister-electric-sql/index.js.gz +0 -0
  130. package/min/persisters/persister-electric-sql/with-schemas/index.js +1 -1
  131. package/min/persisters/persister-electric-sql/with-schemas/index.js.gz +0 -0
  132. package/min/persisters/persister-expo-sqlite/index.js +1 -1
  133. package/min/persisters/persister-expo-sqlite/index.js.gz +0 -0
  134. package/min/persisters/persister-expo-sqlite/with-schemas/index.js +1 -1
  135. package/min/persisters/persister-expo-sqlite/with-schemas/index.js.gz +0 -0
  136. package/min/persisters/persister-file/index.js +1 -1
  137. package/min/persisters/persister-file/index.js.gz +0 -0
  138. package/min/persisters/persister-file/with-schemas/index.js +1 -1
  139. package/min/persisters/persister-file/with-schemas/index.js.gz +0 -0
  140. package/min/persisters/persister-indexed-db/index.js +1 -1
  141. package/min/persisters/persister-indexed-db/index.js.gz +0 -0
  142. package/min/persisters/persister-indexed-db/with-schemas/index.js +1 -1
  143. package/min/persisters/persister-indexed-db/with-schemas/index.js.gz +0 -0
  144. package/min/persisters/persister-libsql/index.js +1 -1
  145. package/min/persisters/persister-libsql/index.js.gz +0 -0
  146. package/min/persisters/persister-libsql/with-schemas/index.js +1 -1
  147. package/min/persisters/persister-libsql/with-schemas/index.js.gz +0 -0
  148. package/min/persisters/persister-partykit-client/index.js +1 -1
  149. package/min/persisters/persister-partykit-client/index.js.gz +0 -0
  150. package/min/persisters/persister-partykit-client/with-schemas/index.js +1 -1
  151. package/min/persisters/persister-partykit-client/with-schemas/index.js.gz +0 -0
  152. package/min/persisters/persister-partykit-server/index.js +1 -1
  153. package/min/persisters/persister-partykit-server/index.js.gz +0 -0
  154. package/min/persisters/persister-partykit-server/with-schemas/index.js +1 -1
  155. package/min/persisters/persister-partykit-server/with-schemas/index.js.gz +0 -0
  156. package/min/persisters/persister-pglite/index.js +1 -1
  157. package/min/persisters/persister-pglite/index.js.gz +0 -0
  158. package/min/persisters/persister-pglite/with-schemas/index.js +1 -1
  159. package/min/persisters/persister-pglite/with-schemas/index.js.gz +0 -0
  160. package/min/persisters/persister-postgres/index.js +1 -1
  161. package/min/persisters/persister-postgres/index.js.gz +0 -0
  162. package/min/persisters/persister-postgres/with-schemas/index.js +1 -1
  163. package/min/persisters/persister-postgres/with-schemas/index.js.gz +0 -0
  164. package/min/persisters/persister-powersync/index.js +1 -1
  165. package/min/persisters/persister-powersync/index.js.gz +0 -0
  166. package/min/persisters/persister-powersync/with-schemas/index.js +1 -1
  167. package/min/persisters/persister-powersync/with-schemas/index.js.gz +0 -0
  168. package/min/persisters/persister-react-native-mmkv/index.js +1 -0
  169. package/min/persisters/persister-react-native-mmkv/index.js.gz +0 -0
  170. package/min/persisters/persister-react-native-mmkv/with-schemas/index.js +1 -0
  171. package/min/persisters/persister-react-native-mmkv/with-schemas/index.js.gz +0 -0
  172. package/min/persisters/persister-react-native-sqlite/index.js +1 -0
  173. package/min/persisters/persister-react-native-sqlite/index.js.gz +0 -0
  174. package/min/persisters/persister-react-native-sqlite/with-schemas/index.js +1 -0
  175. package/min/persisters/persister-react-native-sqlite/with-schemas/index.js.gz +0 -0
  176. package/min/persisters/persister-remote/index.js +1 -1
  177. package/min/persisters/persister-remote/index.js.gz +0 -0
  178. package/min/persisters/persister-remote/with-schemas/index.js +1 -1
  179. package/min/persisters/persister-remote/with-schemas/index.js.gz +0 -0
  180. package/min/persisters/persister-sqlite-bun/index.js +1 -1
  181. package/min/persisters/persister-sqlite-bun/index.js.gz +0 -0
  182. package/min/persisters/persister-sqlite-bun/with-schemas/index.js +1 -1
  183. package/min/persisters/persister-sqlite-bun/with-schemas/index.js.gz +0 -0
  184. package/min/persisters/persister-sqlite-wasm/index.js +1 -1
  185. package/min/persisters/persister-sqlite-wasm/index.js.gz +0 -0
  186. package/min/persisters/persister-sqlite-wasm/with-schemas/index.js +1 -1
  187. package/min/persisters/persister-sqlite-wasm/with-schemas/index.js.gz +0 -0
  188. package/min/persisters/persister-sqlite3/index.js +1 -1
  189. package/min/persisters/persister-sqlite3/index.js.gz +0 -0
  190. package/min/persisters/persister-sqlite3/with-schemas/index.js +1 -1
  191. package/min/persisters/persister-sqlite3/with-schemas/index.js.gz +0 -0
  192. package/min/persisters/persister-yjs/index.js +1 -1
  193. package/min/persisters/persister-yjs/index.js.gz +0 -0
  194. package/min/persisters/persister-yjs/with-schemas/index.js +1 -1
  195. package/min/persisters/persister-yjs/with-schemas/index.js.gz +0 -0
  196. package/min/persisters/with-schemas/index.js +1 -1
  197. package/min/persisters/with-schemas/index.js.gz +0 -0
  198. package/min/queries/index.js +1 -1
  199. package/min/queries/index.js.gz +0 -0
  200. package/min/queries/with-schemas/index.js +1 -1
  201. package/min/queries/with-schemas/index.js.gz +0 -0
  202. package/min/relationships/index.js +1 -1
  203. package/min/relationships/index.js.gz +0 -0
  204. package/min/relationships/with-schemas/index.js +1 -1
  205. package/min/relationships/with-schemas/index.js.gz +0 -0
  206. package/min/store/index.js +1 -1
  207. package/min/store/index.js.gz +0 -0
  208. package/min/store/with-schemas/index.js +1 -1
  209. package/min/store/with-schemas/index.js.gz +0 -0
  210. package/min/synchronizers/index.js +1 -1
  211. package/min/synchronizers/index.js.gz +0 -0
  212. package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
  213. package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
  214. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
  215. package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
  216. package/min/synchronizers/synchronizer-local/index.js +1 -1
  217. package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  218. package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  219. package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  220. package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  221. package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  222. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  223. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  224. package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
  225. package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
  226. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
  227. package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
  228. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
  229. package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
  230. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
  231. package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
  232. package/min/synchronizers/synchronizer-ws-server-simple/index.js +1 -1
  233. package/min/synchronizers/synchronizer-ws-server-simple/index.js.gz +0 -0
  234. package/min/synchronizers/synchronizer-ws-server-simple/with-schemas/index.js +1 -1
  235. package/min/synchronizers/synchronizer-ws-server-simple/with-schemas/index.js.gz +0 -0
  236. package/min/synchronizers/with-schemas/index.js +1 -1
  237. package/min/synchronizers/with-schemas/index.js.gz +0 -0
  238. package/min/ui-react/index.js +1 -1
  239. package/min/ui-react/index.js.gz +0 -0
  240. package/min/ui-react/with-schemas/index.js +1 -1
  241. package/min/ui-react/with-schemas/index.js.gz +0 -0
  242. package/min/ui-react-dom/index.js +1 -1
  243. package/min/ui-react-dom/index.js.gz +0 -0
  244. package/min/ui-react-dom/with-schemas/index.js +1 -1
  245. package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  246. package/min/ui-react-inspector/index.js +1 -1
  247. package/min/ui-react-inspector/index.js.gz +0 -0
  248. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  249. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  250. package/min/with-schemas/index.js +1 -1
  251. package/min/with-schemas/index.js.gz +0 -0
  252. package/omni/index.js +2178 -1203
  253. package/omni/with-schemas/index.js +2178 -1203
  254. package/package.json +91 -11
  255. package/persisters/index.js +16 -10
  256. package/persisters/persister-automerge/index.js +15 -9
  257. package/persisters/persister-automerge/with-schemas/index.js +15 -9
  258. package/persisters/persister-browser/index.js +41 -9
  259. package/persisters/persister-browser/with-schemas/index.js +41 -9
  260. package/persisters/persister-cr-sqlite-wasm/index.js +16 -10
  261. package/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +16 -10
  262. package/persisters/persister-durable-object-sql-storage/index.js +16 -10
  263. package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +16 -10
  264. package/persisters/persister-durable-object-storage/index.js +14 -8
  265. package/persisters/persister-durable-object-storage/with-schemas/index.js +14 -8
  266. package/persisters/persister-electric-sql/index.js +16 -10
  267. package/persisters/persister-electric-sql/with-schemas/index.js +16 -10
  268. package/persisters/persister-expo-sqlite/index.js +16 -10
  269. package/persisters/persister-expo-sqlite/with-schemas/index.js +16 -10
  270. package/persisters/persister-file/index.js +14 -8
  271. package/persisters/persister-file/with-schemas/index.js +14 -8
  272. package/persisters/persister-indexed-db/index.js +14 -8
  273. package/persisters/persister-indexed-db/with-schemas/index.js +14 -8
  274. package/persisters/persister-libsql/index.js +16 -10
  275. package/persisters/persister-libsql/with-schemas/index.js +16 -10
  276. package/persisters/persister-partykit-client/index.js +14 -8
  277. package/persisters/persister-partykit-client/with-schemas/index.js +14 -8
  278. package/persisters/persister-partykit-server/index.js +7 -3
  279. package/persisters/persister-partykit-server/with-schemas/index.js +7 -3
  280. package/persisters/persister-pglite/index.js +15 -9
  281. package/persisters/persister-pglite/with-schemas/index.js +15 -9
  282. package/persisters/persister-postgres/index.js +15 -9
  283. package/persisters/persister-postgres/with-schemas/index.js +15 -9
  284. package/persisters/persister-powersync/index.js +16 -10
  285. package/persisters/persister-powersync/with-schemas/index.js +16 -10
  286. package/persisters/persister-react-native-mmkv/index.js +465 -0
  287. package/persisters/persister-react-native-mmkv/with-schemas/index.js +465 -0
  288. package/persisters/persister-react-native-sqlite/index.js +1195 -0
  289. package/persisters/persister-react-native-sqlite/with-schemas/index.js +1195 -0
  290. package/persisters/persister-remote/index.js +16 -10
  291. package/persisters/persister-remote/with-schemas/index.js +16 -10
  292. package/persisters/persister-sqlite-bun/index.js +16 -10
  293. package/persisters/persister-sqlite-bun/with-schemas/index.js +16 -10
  294. package/persisters/persister-sqlite-wasm/index.js +16 -10
  295. package/persisters/persister-sqlite-wasm/with-schemas/index.js +16 -10
  296. package/persisters/persister-sqlite3/index.js +16 -10
  297. package/persisters/persister-sqlite3/with-schemas/index.js +16 -10
  298. package/persisters/persister-yjs/index.js +20 -12
  299. package/persisters/persister-yjs/with-schemas/index.js +20 -12
  300. package/persisters/with-schemas/index.js +16 -10
  301. package/queries/index.js +20 -12
  302. package/queries/with-schemas/index.js +20 -12
  303. package/readme.md +13 -13
  304. package/relationships/index.js +10 -5
  305. package/relationships/with-schemas/index.js +10 -5
  306. package/releases.md +179 -41
  307. package/store/index.js +50 -18
  308. package/store/with-schemas/index.js +50 -18
  309. package/synchronizers/index.js +16 -10
  310. package/synchronizers/synchronizer-broadcast-channel/index.js +17 -11
  311. package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +17 -11
  312. package/synchronizers/synchronizer-local/index.js +17 -11
  313. package/synchronizers/synchronizer-local/with-schemas/index.js +17 -11
  314. package/synchronizers/synchronizer-ws-client/index.js +16 -10
  315. package/synchronizers/synchronizer-ws-client/with-schemas/index.js +16 -10
  316. package/synchronizers/synchronizer-ws-server/index.js +16 -10
  317. package/synchronizers/synchronizer-ws-server/with-schemas/index.js +16 -10
  318. package/synchronizers/synchronizer-ws-server-durable-object/index.js +16 -10
  319. package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +16 -10
  320. package/synchronizers/synchronizer-ws-server-simple/index.js +8 -4
  321. package/synchronizers/synchronizer-ws-server-simple/with-schemas/index.js +8 -4
  322. package/synchronizers/with-schemas/index.js +16 -10
  323. package/ui-react/index.js +408 -374
  324. package/ui-react/with-schemas/index.js +408 -374
  325. package/ui-react-dom/index.js +883 -437
  326. package/ui-react-dom/with-schemas/index.js +883 -437
  327. package/ui-react-inspector/index.js +1761 -556
  328. package/ui-react-inspector/with-schemas/index.js +1761 -556
  329. package/with-schemas/index.js +63 -31
@@ -32,8 +32,7 @@ import type {DatabasePersisterConfig, Persister, Persists} from '../index.d.ts';
32
32
  * @category Persister
33
33
  * @since v4.5.0
34
34
  */
35
- export interface ExpoSqlitePersister
36
- extends Persister<Persists.StoreOrMergeableStore> {
35
+ export interface ExpoSqlitePersister extends Persister<Persists.StoreOrMergeableStore> {
37
36
  /**
38
37
  * The getDb method returns a reference to the database instance the Store is
39
38
  * being persisted to.
@@ -87,6 +86,10 @@ export interface ExpoSqlitePersister
87
86
  *
88
87
  * See the documentation for the DpcJson and DpcTabular types for more
89
88
  * information on how both of those modes can be configured.
89
+ *
90
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
91
+ * values, making tables dense (every Row has every Cell). See the Database
92
+ * Persistence guide for details.
90
93
  * @param store The Store or MergeableStore to persist.
91
94
  * @param db The database instance that was returned from
92
95
  * `SQLite.openDatabase(...)`.
@@ -39,8 +39,9 @@ import type {
39
39
  * @category Persister
40
40
  * @since v4.5.0
41
41
  */
42
- export interface ExpoSqlitePersister<Schemas extends OptionalSchemas>
43
- extends Persister<Schemas, Persists.StoreOrMergeableStore> {
42
+ export interface ExpoSqlitePersister<
43
+ Schemas extends OptionalSchemas,
44
+ > extends Persister<Schemas, Persists.StoreOrMergeableStore> {
44
45
  /**
45
46
  * The getDb method returns a reference to the database instance the Store is
46
47
  * being persisted to.
@@ -106,6 +107,10 @@ export interface ExpoSqlitePersister<Schemas extends OptionalSchemas>
106
107
  *
107
108
  * See the documentation for the DpcJson and DpcTabular types for more
108
109
  * information on how both of those modes can be configured.
110
+ *
111
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
112
+ * values, making tables dense (every Row has every Cell). See the Database
113
+ * Persistence guide for details.
109
114
  * @param store The Store or MergeableStore to persist.
110
115
  * @param db The database instance that was returned from
111
116
  * `SQLite.openDatabase(...)`.
@@ -23,8 +23,7 @@ import type {Persister, Persists} from '../index.d.ts';
23
23
  * @category Persister
24
24
  * @since v4.3.14
25
25
  */
26
- export interface FilePersister
27
- extends Persister<Persists.StoreOrMergeableStore> {
26
+ export interface FilePersister extends Persister<Persists.StoreOrMergeableStore> {
28
27
  /**
29
28
  * The getFilePath method returns the location of the local file the Store is
30
29
  * being persisted to.
@@ -26,8 +26,9 @@ import type {Persister, Persists} from '../../with-schemas/index.d.ts';
26
26
  * @category Persister
27
27
  * @since v4.3.14
28
28
  */
29
- export interface FilePersister<Schemas extends OptionalSchemas>
30
- extends Persister<Schemas, Persists.StoreOrMergeableStore> {
29
+ export interface FilePersister<
30
+ Schemas extends OptionalSchemas,
31
+ > extends Persister<Schemas, Persists.StoreOrMergeableStore> {
31
32
  /**
32
33
  * The getFilePath method returns the location of the local file the Store is
33
34
  * being persisted to.
@@ -25,8 +25,9 @@ import type {Persister} from '../../with-schemas/index.d.ts';
25
25
  * @category Persister
26
26
  * @since v4.3.14
27
27
  */
28
- export interface IndexedDbPersister<Schemas extends OptionalSchemas>
29
- extends Persister<Schemas> {
28
+ export interface IndexedDbPersister<
29
+ Schemas extends OptionalSchemas,
30
+ > extends Persister<Schemas> {
30
31
  /**
31
32
  * The getDbName method returns the unique key of the IndexedDB the Store is
32
33
  * being persisted to.
@@ -74,6 +74,10 @@ export interface LibSqlPersister extends Persister {
74
74
  *
75
75
  * See the documentation for the DpcJson and DpcTabular types for more
76
76
  * information on how both of those modes can be configured.
77
+ *
78
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
79
+ * values, making tables dense (every Row has every Cell). See the Database
80
+ * Persistence guide for details.
77
81
  * @param store The Store to persist.
78
82
  * @param client The database client that was returned from `createClient(...)`.
79
83
  * @param configOrStoreTableName A DatabasePersisterConfig to configure the
@@ -30,8 +30,9 @@ import type {
30
30
  * @category Persister
31
31
  * @since v4.7.0
32
32
  */
33
- export interface LibSqlPersister<Schemas extends OptionalSchemas>
34
- extends Persister<Schemas> {
33
+ export interface LibSqlPersister<
34
+ Schemas extends OptionalSchemas,
35
+ > extends Persister<Schemas> {
35
36
  /**
36
37
  * The getClient method returns a reference to the database client the Store
37
38
  * is being persisted to.
@@ -93,6 +94,10 @@ export interface LibSqlPersister<Schemas extends OptionalSchemas>
93
94
  *
94
95
  * See the documentation for the DpcJson and DpcTabular types for more
95
96
  * information on how both of those modes can be configured.
97
+ *
98
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
99
+ * values, making tables dense (every Row has every Cell). See the Database
100
+ * Persistence guide for details.
96
101
  * @param store The Store to persist.
97
102
  * @param client The database client that was returned from `createClient(...)`.
98
103
  * @param configOrStoreTableName A DatabasePersisterConfig to configure the
@@ -38,8 +38,9 @@ import type {Persister} from '../../with-schemas/index.d.ts';
38
38
  * @category Persister
39
39
  * @since v4.3.14
40
40
  */
41
- export interface PartyKitPersister<Schemas extends OptionalSchemas>
42
- extends Persister<Schemas> {
41
+ export interface PartyKitPersister<
42
+ Schemas extends OptionalSchemas,
43
+ > extends Persister<Schemas> {
43
44
  /**
44
45
  * The getConnection method returns the PartySocket the Store is being
45
46
  * persisted to.
@@ -24,8 +24,7 @@ import type {DatabasePersisterConfig, Persister, Persists} from '../index.d.ts';
24
24
  * @category Persister
25
25
  * @since 5.2.0
26
26
  */
27
- export interface PglitePersister
28
- extends Persister<Persists.StoreOrMergeableStore> {
27
+ export interface PglitePersister extends Persister<Persists.StoreOrMergeableStore> {
29
28
  /**
30
29
  * The getPglite method returns a reference to the database connection the
31
30
  * Store is being persisted to.
@@ -82,7 +81,11 @@ export interface PglitePersister
82
81
  * See the documentation for the DpcJson and DpcTabular types for more
83
82
  * information on how both of those modes can be configured.
84
83
  *
85
- * This method is asynchronous because it will await the creation of dedicated
84
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
85
+ * values, making tables dense (every Row has every Cell). See the Database
86
+ * Persistence guide for details.
87
+ *
88
+ * This method is asynchronous because it will await the completion of the
86
89
  * new connections to the database. You will need to `await` a call to this
87
90
  * function or handle the return type natively as a Promise.
88
91
  * @param store The Store or MergeableStore to persist.
@@ -166,6 +169,7 @@ export interface PglitePersister
166
169
  * await pglite.close();
167
170
  * ```
168
171
  * @category Creation
172
+ * @essential Persisting stores
169
173
  * @since 5.2.0
170
174
  */
171
175
  export function createPglitePersister(
@@ -31,8 +31,9 @@ import type {
31
31
  * @category Persister
32
32
  * @since 5.2.0
33
33
  */
34
- export interface PglitePersister<Schemas extends OptionalSchemas>
35
- extends Persister<Schemas, Persists.StoreOrMergeableStore> {
34
+ export interface PglitePersister<
35
+ Schemas extends OptionalSchemas,
36
+ > extends Persister<Schemas, Persists.StoreOrMergeableStore> {
36
37
  /**
37
38
  * The getPglite method returns a reference to the database connection the
38
39
  * Store is being persisted to.
@@ -101,7 +102,11 @@ export interface PglitePersister<Schemas extends OptionalSchemas>
101
102
  * See the documentation for the DpcJson and DpcTabular types for more
102
103
  * information on how both of those modes can be configured.
103
104
  *
104
- * This method is asynchronous because it will await the creation of dedicated
105
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
106
+ * values, making tables dense (every Row has every Cell). See the Database
107
+ * Persistence guide for details.
108
+ *
109
+ * This method is asynchronous because it will await the completion of the
105
110
  * new connections to the database. You will need to `await` a call to this
106
111
  * function or handle the return type natively as a Promise.
107
112
  * @param store The Store or MergeableStore to persist.
@@ -185,6 +190,7 @@ export interface PglitePersister<Schemas extends OptionalSchemas>
185
190
  * await pglite.close();
186
191
  * ```
187
192
  * @category Creation
193
+ * @essential Persisting stores
188
194
  * @since 5.2.0
189
195
  */
190
196
  export function createPglitePersister<Schemas extends OptionalSchemas>(
@@ -24,8 +24,7 @@ import type {DatabasePersisterConfig, Persister, Persists} from '../index.d.ts';
24
24
  * @category Persister
25
25
  * @since 5.2.0
26
26
  */
27
- export interface PostgresPersister
28
- extends Persister<Persists.StoreOrMergeableStore> {
27
+ export interface PostgresPersister extends Persister<Persists.StoreOrMergeableStore> {
29
28
  /**
30
29
  * The getSql method returns a reference to the database connection the Store
31
30
  * is being persisted to.
@@ -78,6 +77,10 @@ export interface PostgresPersister
78
77
  * See the documentation for the DpcJson and DpcTabular types for more
79
78
  * information on how both of those modes can be configured.
80
79
  *
80
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
81
+ * values, making tables dense (every Row has every Cell). See the Database
82
+ * Persistence guide for details.
83
+ *
81
84
  * This method is asynchronous because it will await the creation of dedicated
82
85
  * new connections to the database. You will need to `await` a call to this
83
86
  * function or handle the return type natively as a Promise.
@@ -31,8 +31,9 @@ import type {
31
31
  * @category Persister
32
32
  * @since 5.2.0
33
33
  */
34
- export interface PostgresPersister<Schemas extends OptionalSchemas>
35
- extends Persister<Schemas, Persists.StoreOrMergeableStore> {
34
+ export interface PostgresPersister<
35
+ Schemas extends OptionalSchemas,
36
+ > extends Persister<Schemas, Persists.StoreOrMergeableStore> {
36
37
  /**
37
38
  * The getSql method returns a reference to the database connection the Store
38
39
  * is being persisted to.
@@ -97,6 +98,10 @@ export interface PostgresPersister<Schemas extends OptionalSchemas>
97
98
  * See the documentation for the DpcJson and DpcTabular types for more
98
99
  * information on how both of those modes can be configured.
99
100
  *
101
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
102
+ * values, making tables dense (every Row has every Cell). See the Database
103
+ * Persistence guide for details.
104
+ *
100
105
  * This method is asynchronous because it will await the creation of dedicated
101
106
  * new connections to the database. You will need to `await` a call to this
102
107
  * function or handle the return type natively as a Promise.
@@ -76,6 +76,10 @@ export interface PowerSyncPersister extends Persister {
76
76
  *
77
77
  * See the documentation for the DpcJson and DpcTabular types for more
78
78
  * information on how both of those modes can be configured.
79
+ *
80
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
81
+ * values, making tables dense (every Row has every Cell). See the Database
82
+ * Persistence guide for details.
79
83
  * @param store The Store to persist.
80
84
  * @param powerSync The PowerSync instance.
81
85
  * @param configOrStoreTableName A DatabasePersisterConfig to configure the
@@ -31,8 +31,9 @@ import type {
31
31
  * @category Persister
32
32
  * @since v4.8.0
33
33
  */
34
- export interface PowerSyncPersister<Schemas extends OptionalSchemas>
35
- extends Persister<Schemas> {
34
+ export interface PowerSyncPersister<
35
+ Schemas extends OptionalSchemas,
36
+ > extends Persister<Schemas> {
36
37
  /**
37
38
  * The getPowerSync method returns a reference to the PowerSync instance the
38
39
  * Store is being persisted to.
@@ -95,6 +96,10 @@ export interface PowerSyncPersister<Schemas extends OptionalSchemas>
95
96
  *
96
97
  * See the documentation for the DpcJson and DpcTabular types for more
97
98
  * information on how both of those modes can be configured.
99
+ *
100
+ * Note: When using tabular mode, SQL NULL values are loaded as TinyBase null
101
+ * values, making tables dense (every Row has every Cell). See the Database
102
+ * Persistence guide for details.
98
103
  * @param store The Store to persist.
99
104
  * @param powerSync The PowerSync instance.
100
105
  * @param configOrStoreTableName A DatabasePersisterConfig to configure the
@@ -0,0 +1,117 @@
1
+ /**
2
+ * The persister-react-native-mmkv module of the TinyBase project lets you save
3
+ * and load Store data to and from a MMKV storage using the
4
+ * [`react-native-mmkv`](https://github.com/mrousavy/react-native-mmkv) module
5
+ * (in an appropriate React Native environment).
6
+ * @see Database Persistence guide
7
+ * @packageDocumentation
8
+ * @module persister-react-native-mmkv
9
+ * @since v6.5.0
10
+ */
11
+ import type {MMKV} from 'react-native-mmkv';
12
+ import type {MergeableStore} from '../../mergeable-store/index.d.ts';
13
+ import type {Store} from '../../store/index.d.ts';
14
+ import type {Persister, Persists} from '../index.d.ts';
15
+
16
+ /**
17
+ * The ReactNativeMmkvPersister interface represents a Persister that lets you
18
+ * save and load Store data to and from a `react-native-mmkv` storage.
19
+ *
20
+ * You should use the createReactNativeMmkvPersister function to create a
21
+ * ReactNativeMmkvPersister object.
22
+ *
23
+ * It is a minor extension to the Persister interface and simply provides an
24
+ * extra getStorageName method for accessing the unique key of the storage
25
+ * location the Store is being persisted to.
26
+ * @category Persister
27
+ * @since v6.5.0
28
+ */
29
+ export interface ReactNativeMmkvPersister extends Persister<Persists.StoreOrMergeableStore> {
30
+ /**
31
+ * The getStorageName method returns the unique key of the storage location the
32
+ * Store is being persisted to.
33
+ * @returns The unique key of the storage location.
34
+ * @example
35
+ * This example creates a Persister object against a newly-created Store and
36
+ * then gets the unique key of the storage location back out again.
37
+ *
38
+ * ```js yolo
39
+ * import {createMMKV} from 'react-native-mmkv';
40
+ * import {createStore} from 'tinybase';
41
+ * import {createReactNativeMmkvPersister} from 'tinybase/persisters/persister-react-native-mmkv';
42
+ *
43
+ * const storage = createMMKV();
44
+ * const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
45
+ * const persister = createReactNativeMmkvPersister(
46
+ * store,
47
+ * storage,
48
+ * 'my_tinybase',
49
+ * );
50
+ * console.log(persister.getStorageName() == 'my_tinybase');
51
+ * // -> true
52
+ *
53
+ * await persister.destroy();
54
+ * ```
55
+ * @category Getter
56
+ * @since v6.5.0
57
+ */
58
+ getStorageName(): string;
59
+ }
60
+
61
+ /**
62
+ * The createReactNativeMmkvPersister function creates a
63
+ * ReactNativeMmkvPersister object that can persist the Store to a local
64
+ * `react-native-mmkv` storage.
65
+ *
66
+ * A ReactNativeMmkvPersister supports both regular Store and MergeableStore
67
+ * objects.
68
+ *
69
+ * As well as providing a reference to the Store to persist, you must provide a
70
+ * `storage` parameter which identifies the MMKV storage instance.
71
+ *
72
+ * The third argument is a `storageName` string that configures which key to use
73
+ * for the storage key.
74
+ * @param store The Store or MergeableStore to persist.
75
+ * @param storage The MMKV storage instance.
76
+ * @param storageName The unique key to identify the storage location.
77
+ * @param onIgnoredError An optional handler for the errors that the Persister
78
+ * would otherwise ignore when trying to save or load data. This is suitable for
79
+ * debugging persistence issues in a development environment.
80
+ * @returns A reference to the new ReactNativeMmkvPersister object.
81
+ * @example
82
+ * This example creates a ReactNativeMmkvPersister object and persists the
83
+ * Store to a MMKV storage instance as a JSON serialization into the
84
+ * `my_tinybase` key. It makes a change to the storage directly and then
85
+ * reloads it back into the Store.
86
+ *
87
+ * ```js yolo
88
+ * import {createMMKV} from 'react-native-mmkv';
89
+ * import {createStore} from 'tinybase';
90
+ * import {createReactNativeMmkvPersister} from 'tinybase/persisters/persister-react-native-mmkv';
91
+ *
92
+ * const storage = createMMKV();
93
+ * const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
94
+ * const persister = createReactNativeMmkvPersister(
95
+ * store,
96
+ * storage,
97
+ * 'my_tinybase',
98
+ * );
99
+ *
100
+ * await persister.save();
101
+ * // Store will be saved to the MMKV storage.
102
+ *
103
+ * console.log(storage.getString('my_tinybase'));
104
+ * // -> '[{"pets":{"fido":{"species":"dog"}}},{}]'
105
+ *
106
+ * await persister.destroy();
107
+ * storage.delete('my_tinybase');
108
+ * ```
109
+ * @category Creation
110
+ * @since v6.5.0
111
+ */
112
+ export function createReactNativeMmkvPersister(
113
+ store: Store | MergeableStore,
114
+ storage: MMKV,
115
+ storageName?: string,
116
+ onIgnoredError?: (error: any) => void,
117
+ ): ReactNativeMmkvPersister;
@@ -0,0 +1,133 @@
1
+ /**
2
+ * The persister-react-native-mmkv module of the TinyBase project lets you save
3
+ * and load Store data to and from a MMKV storage using the
4
+ * [`react-native-mmkv`](https://github.com/mrousavy/react-native-mmkv) module
5
+ * (in an appropriate React Native environment).
6
+ * @see Database Persistence guide
7
+ * @packageDocumentation
8
+ * @module persister-react-native-mmkv
9
+ * @since v6.5.0
10
+ */
11
+ import type {MMKV} from 'react-native-mmkv';
12
+ import type {MergeableStore} from '../../../mergeable-store/with-schemas/index.d.ts';
13
+ import type {
14
+ OptionalSchemas,
15
+ Store,
16
+ } from '../../../store/with-schemas/index.d.ts';
17
+ import type {Persister, Persists} from '../../with-schemas/index.d.ts';
18
+
19
+ /**
20
+ * The ReactNativeMmkvPersister interface represents a Persister that lets you
21
+ * save and load Store data to and from a `react-native-mmkv` storage.
22
+ *
23
+ * You should use the createReactNativeMmkvPersister function to create a
24
+ * ReactNativeMmkvPersister object.
25
+ *
26
+ * It is a minor extension to the Persister interface and simply provides an
27
+ * extra getStorageName method for accessing the unique key of the storage
28
+ * location the Store is being persisted to.
29
+ * @category Persister
30
+ * @since v6.5.0
31
+ */
32
+ export interface ReactNativeMmkvPersister<
33
+ Schemas extends OptionalSchemas,
34
+ > extends Persister<Schemas, Persists.StoreOrMergeableStore> {
35
+ /**
36
+ * The getStorageName method returns the unique key of the storage location the
37
+ * Store is being persisted to.
38
+ * @returns The unique key of the storage location.
39
+ * @example
40
+ * This example creates a Persister object against a newly-created Store and
41
+ * then gets the unique key of the storage location back out again.
42
+ *
43
+ * ```js yolo
44
+ * import {createMMKV} from 'react-native-mmkv';
45
+ * import {createStore} from 'tinybase';
46
+ * import {createReactNativeMmkvPersister} from 'tinybase/persisters/persister-react-native-mmkv';
47
+ *
48
+ * const storage = createMMKV();
49
+ * const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
50
+ * const persister = createReactNativeMmkvPersister(
51
+ * store,
52
+ * storage,
53
+ * 'my_tinybase',
54
+ * );
55
+ * console.log(persister.getStorageName() == 'my_tinybase');
56
+ * // -> true
57
+ *
58
+ * await persister.destroy();
59
+ * ```
60
+ * @category Getter
61
+ * @since v6.5.0
62
+ */
63
+ getStorageName(): string;
64
+ }
65
+
66
+ /**
67
+ * The createReactNativeMmkvPersister function creates a
68
+ * ReactNativeMmkvPersister object that can persist the Store to a local
69
+ * `react-native-mmkv` storage.
70
+ *
71
+ * This has schema-based typing. The following is a simplified representation:
72
+ *
73
+ * ```ts override
74
+ * createReactNativeMmkvPersister(
75
+ * store: Store | MergeableStore,
76
+ * storage: MMKV,
77
+ * storageName?: string,
78
+ * onIgnoredError?: (error: any) => void,
79
+ * ): ReactNativeMmkvPersister;
80
+ * ```
81
+ *
82
+ * A ReactNativeMmkvPersister supports both regular Store and MergeableStore
83
+ * objects.
84
+ *
85
+ * As well as providing a reference to the Store to persist, you must provide a
86
+ * `storage` parameter which identifies the MMKV storage instance.
87
+ *
88
+ * The third argument is a `storageName` string that configures which key to use
89
+ * for the storage key.
90
+ * @param store The Store or MergeableStore to persist.
91
+ * @param storage The MMKV storage instance.
92
+ * @param storageName The unique key to identify the storage location.
93
+ * @param onIgnoredError An optional handler for the errors that the Persister
94
+ * would otherwise ignore when trying to save or load data. This is suitable for
95
+ * debugging persistence issues in a development environment.
96
+ * @returns A reference to the new ReactNativeMmkvPersister object.
97
+ * @example
98
+ * This example creates a ReactNativeMmkvPersister object and persists the
99
+ * Store to a MMKV storage instance as a JSON serialization into the
100
+ * `my_tinybase` key. It makes a change to the storage directly and then
101
+ * reloads it back into the Store.
102
+ *
103
+ * ```js yolo
104
+ * import {createMMKV} from 'react-native-mmkv';
105
+ * import {createStore} from 'tinybase';
106
+ * import {createReactNativeMmkvPersister} from 'tinybase/persisters/persister-react-native-mmkv';
107
+ *
108
+ * const storage = createMMKV();
109
+ * const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
110
+ * const persister = createReactNativeMmkvPersister(
111
+ * store,
112
+ * storage,
113
+ * 'my_tinybase',
114
+ * );
115
+ *
116
+ * await persister.save();
117
+ * // Store will be saved to the MMKV storage.
118
+ *
119
+ * console.log(storage.getString('my_tinybase'));
120
+ * // -> '[{"pets":{"fido":{"species":"dog"}}},{}]'
121
+ *
122
+ * await persister.destroy();
123
+ * storage.delete('my_tinybase');
124
+ * ```
125
+ * @category Creation
126
+ * @since v6.5.0
127
+ */
128
+ export function createReactNativeMmkvPersister<Schemas extends OptionalSchemas>(
129
+ store: Store<Schemas> | MergeableStore<Schemas>,
130
+ storage: MMKV,
131
+ storageName?: string,
132
+ onIgnoredError?: (error: any) => void,
133
+ ): ReactNativeMmkvPersister<Schemas>;