tinybase 5.2.0-beta.5 → 5.3.0-beta.0

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.
@@ -19,23 +19,28 @@
19
19
  * |Sqlite3Persister|SQLite in Node, via [sqlite3](https://github.com/TryGhost/node-sqlite3)|Yes|Yes*
20
20
  * |SqliteWasmPersister|SQLite in a browser, via [sqlite-wasm](https://github.com/tomayac/sqlite-wasm)|Yes|Yes*
21
21
  * |ExpoSqlitePersister|SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite)|Yes|Yes*
22
+ * |PostgresPersister|PostgreSQL, via [postgres](https://github.com/porsager/postgres)|Yes|Yes*
23
+ * |PglitePersister|PostgreSQL, via [PGlite](https://github.com/electric-sql/pglite)|Yes|Yes*
22
24
  * |CrSqliteWasmPersister|SQLite CRDTs, via [cr-sqlite-wasm](https://github.com/vlcn-io/cr-sqlite)|Yes|No
23
25
  * |ElectricSqlPersister|Electric SQL, via [electric-sql](https://github.com/electric-sql/electric)|Yes|No
24
26
  * |LibSqlPersister|LibSQL for Turso, via [libsql-client](https://github.com/tursodatabase/libsql-client-ts)|Yes|No
25
27
  * |PowerSyncPersister|PowerSync, via [powersync-sdk](https://github.com/powersync-ja/powersync-js)|Yes|No
26
- * |PostgresPersister|PostgreSQL, via [postgres](https://github.com/porsager/postgres)|Yes|No
27
- * |PglitePersister|PostgreSQL, via [PGlite](https://github.com/electric-sql/pglite)|Yes|No
28
28
  * |YjsPersister|Yjs CRDTs, via [yjs](https://github.com/yjs/yjs)|Yes|No
29
29
  * |AutomergePersister|Automerge CRDTs, via [automerge-repo](https://github.com/automerge/automerge-repo)|Yes|No
30
30
  * |PartyKitPersister|[PartyKit](https://www.partykit.io/), via the persister-partykit-server module|Yes|No|
31
31
  *
32
- * (*) Note that SQLite-based Persisters can currently only persist
33
- * MergeableStore data when using the JSON-based DpcJson mode, and not in a
34
- * tabular fashion.
32
+ * (*) Note that SQLite- and PostgreSQL-based Persisters can currently only
33
+ * persist MergeableStore data when used with the JSON-based DpcJson mode, and
34
+ * not when using the DpcTabular mode.
35
35
  *
36
36
  * Since persistence requirements can be different for every app, the
37
37
  * createCustomPersister function in this module can also be used to easily
38
38
  * create a fully customized way to save and load Store data.
39
+ *
40
+ * Similarly, the createCustomSqlitePersister function and
41
+ * createCustomPostgreSqlPersister function can be used to build Persister objects
42
+ * against SQLite and PostgreSQL SDKs (or forks) that are not already included
43
+ * with TinyBase.
39
44
  * @see Persistence guides
40
45
  * @see Countries demo
41
46
  * @see Todo App demos
@@ -19,23 +19,28 @@
19
19
  * |Sqlite3Persister|SQLite in Node, via [sqlite3](https://github.com/TryGhost/node-sqlite3)|Yes|Yes*
20
20
  * |SqliteWasmPersister|SQLite in a browser, via [sqlite-wasm](https://github.com/tomayac/sqlite-wasm)|Yes|Yes*
21
21
  * |ExpoSqlitePersister|SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite)|Yes|Yes*
22
+ * |PostgresPersister|PostgreSQL, via [postgres](https://github.com/porsager/postgres)|Yes|Yes*
23
+ * |PglitePersister|PostgreSQL, via [PGlite](https://github.com/electric-sql/pglite)|Yes|Yes*
22
24
  * |CrSqliteWasmPersister|SQLite CRDTs, via [cr-sqlite-wasm](https://github.com/vlcn-io/cr-sqlite)|Yes|No
23
25
  * |ElectricSqlPersister|Electric SQL, via [electric-sql](https://github.com/electric-sql/electric)|Yes|No
24
26
  * |LibSqlPersister|LibSQL for Turso, via [libsql-client](https://github.com/tursodatabase/libsql-client-ts)|Yes|No
25
27
  * |PowerSyncPersister|PowerSync, via [powersync-sdk](https://github.com/powersync-ja/powersync-js)|Yes|No
26
- * |PostgresPersister|PostgreSQL, via [postgres](https://github.com/porsager/postgres)|Yes|No
27
- * |PglitePersister|PostgreSQL, via [PGlite](https://github.com/electric-sql/pglite)|Yes|No
28
28
  * |YjsPersister|Yjs CRDTs, via [yjs](https://github.com/yjs/yjs)|Yes|No
29
29
  * |AutomergePersister|Automerge CRDTs, via [automerge-repo](https://github.com/automerge/automerge-repo)|Yes|No
30
30
  * |PartyKitPersister|[PartyKit](https://www.partykit.io/), via the persister-partykit-server module|Yes|No|
31
31
  *
32
- * (*) Note that SQLite-based Persisters can currently only persist
33
- * MergeableStore data when using the JSON-based DpcJson mode, and not in a
34
- * tabular fashion.
32
+ * (*) Note that SQLite- and PostgreSQL-based Persisters can currently only
33
+ * persist MergeableStore data when used with the JSON-based DpcJson mode, and
34
+ * not when using the DpcTabular mode.
35
35
  *
36
36
  * Since persistence requirements can be different for every app, the
37
37
  * createCustomPersister function in this module can also be used to easily
38
38
  * create a fully customized way to save and load Store data.
39
+ *
40
+ * Similarly, the createCustomSqlitePersister function and
41
+ * createCustomPostgreSqlPersister function can be used to build Persister objects
42
+ * against SQLite and PostgreSQL SDKs (or forks) that are not already included
43
+ * with TinyBase.
39
44
  * @see Persistence guides
40
45
  * @see Countries demo
41
46
  * @see Todo App demos
@@ -19,23 +19,28 @@
19
19
  * |Sqlite3Persister|SQLite in Node, via [sqlite3](https://github.com/TryGhost/node-sqlite3)|Yes|Yes*
20
20
  * |SqliteWasmPersister|SQLite in a browser, via [sqlite-wasm](https://github.com/tomayac/sqlite-wasm)|Yes|Yes*
21
21
  * |ExpoSqlitePersister|SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite)|Yes|Yes*
22
+ * |PostgresPersister|PostgreSQL, via [postgres](https://github.com/porsager/postgres)|Yes|Yes*
23
+ * |PglitePersister|PostgreSQL, via [PGlite](https://github.com/electric-sql/pglite)|Yes|Yes*
22
24
  * |CrSqliteWasmPersister|SQLite CRDTs, via [cr-sqlite-wasm](https://github.com/vlcn-io/cr-sqlite)|Yes|No
23
25
  * |ElectricSqlPersister|Electric SQL, via [electric-sql](https://github.com/electric-sql/electric)|Yes|No
24
26
  * |LibSqlPersister|LibSQL for Turso, via [libsql-client](https://github.com/tursodatabase/libsql-client-ts)|Yes|No
25
27
  * |PowerSyncPersister|PowerSync, via [powersync-sdk](https://github.com/powersync-ja/powersync-js)|Yes|No
26
- * |PostgresPersister|PostgreSQL, via [postgres](https://github.com/porsager/postgres)|Yes|No
27
- * |PglitePersister|PostgreSQL, via [PGlite](https://github.com/electric-sql/pglite)|Yes|No
28
28
  * |YjsPersister|Yjs CRDTs, via [yjs](https://github.com/yjs/yjs)|Yes|No
29
29
  * |AutomergePersister|Automerge CRDTs, via [automerge-repo](https://github.com/automerge/automerge-repo)|Yes|No
30
30
  * |PartyKitPersister|[PartyKit](https://www.partykit.io/), via the persister-partykit-server module|Yes|No|
31
31
  *
32
- * (*) Note that SQLite-based Persisters can currently only persist
33
- * MergeableStore data when using the JSON-based DpcJson mode, and not in a
34
- * tabular fashion.
32
+ * (*) Note that SQLite- and PostgreSQL-based Persisters can currently only
33
+ * persist MergeableStore data when used with the JSON-based DpcJson mode, and
34
+ * not when using the DpcTabular mode.
35
35
  *
36
36
  * Since persistence requirements can be different for every app, the
37
37
  * createCustomPersister function in this module can also be used to easily
38
38
  * create a fully customized way to save and load Store data.
39
+ *
40
+ * Similarly, the createCustomSqlitePersister function and
41
+ * createCustomPostgreSqlPersister function can be used to build Persister objects
42
+ * against SQLite and PostgreSQL SDKs (or forks) that are not already included
43
+ * with TinyBase.
39
44
  * @see Persistence guides
40
45
  * @see Countries demo
41
46
  * @see Todo App demos
@@ -19,23 +19,28 @@
19
19
  * |Sqlite3Persister|SQLite in Node, via [sqlite3](https://github.com/TryGhost/node-sqlite3)|Yes|Yes*
20
20
  * |SqliteWasmPersister|SQLite in a browser, via [sqlite-wasm](https://github.com/tomayac/sqlite-wasm)|Yes|Yes*
21
21
  * |ExpoSqlitePersister|SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite)|Yes|Yes*
22
+ * |PostgresPersister|PostgreSQL, via [postgres](https://github.com/porsager/postgres)|Yes|Yes*
23
+ * |PglitePersister|PostgreSQL, via [PGlite](https://github.com/electric-sql/pglite)|Yes|Yes*
22
24
  * |CrSqliteWasmPersister|SQLite CRDTs, via [cr-sqlite-wasm](https://github.com/vlcn-io/cr-sqlite)|Yes|No
23
25
  * |ElectricSqlPersister|Electric SQL, via [electric-sql](https://github.com/electric-sql/electric)|Yes|No
24
26
  * |LibSqlPersister|LibSQL for Turso, via [libsql-client](https://github.com/tursodatabase/libsql-client-ts)|Yes|No
25
27
  * |PowerSyncPersister|PowerSync, via [powersync-sdk](https://github.com/powersync-ja/powersync-js)|Yes|No
26
- * |PostgresPersister|PostgreSQL, via [postgres](https://github.com/porsager/postgres)|Yes|No
27
- * |PglitePersister|PostgreSQL, via [PGlite](https://github.com/electric-sql/pglite)|Yes|No
28
28
  * |YjsPersister|Yjs CRDTs, via [yjs](https://github.com/yjs/yjs)|Yes|No
29
29
  * |AutomergePersister|Automerge CRDTs, via [automerge-repo](https://github.com/automerge/automerge-repo)|Yes|No
30
30
  * |PartyKitPersister|[PartyKit](https://www.partykit.io/), via the persister-partykit-server module|Yes|No|
31
31
  *
32
- * (*) Note that SQLite-based Persisters can currently only persist
33
- * MergeableStore data when using the JSON-based DpcJson mode, and not in a
34
- * tabular fashion.
32
+ * (*) Note that SQLite- and PostgreSQL-based Persisters can currently only
33
+ * persist MergeableStore data when used with the JSON-based DpcJson mode, and
34
+ * not when using the DpcTabular mode.
35
35
  *
36
36
  * Since persistence requirements can be different for every app, the
37
37
  * createCustomPersister function in this module can also be used to easily
38
38
  * create a fully customized way to save and load Store data.
39
+ *
40
+ * Similarly, the createCustomSqlitePersister function and
41
+ * createCustomPostgreSqlPersister function can be used to build Persister objects
42
+ * against SQLite and PostgreSQL SDKs (or forks) that are not already included
43
+ * with TinyBase.
39
44
  * @see Persistence guides
40
45
  * @see Countries demo
41
46
  * @see Todo App demos
@@ -124,7 +124,7 @@ export interface WsServer {
124
124
  * @category Getter
125
125
  * @since v5.0.0
126
126
  */
127
- getWebSocketServer: () => WebSocketServer;
127
+ getWebSocketServer(): WebSocketServer;
128
128
  /**
129
129
  * The getPathIds method returns the active paths that the WsServer is
130
130
  * handling.
@@ -174,7 +174,7 @@ export interface WsServer {
174
174
  * @category Getter
175
175
  * @since v5.0.0
176
176
  */
177
- getPathIds: () => Ids;
177
+ getPathIds(): Ids;
178
178
  /**
179
179
  * The getClientIds method method returns the active clients that the WsServer
180
180
  * is handling for a given path.
@@ -222,7 +222,7 @@ export interface WsServer {
222
222
  * @category Getter
223
223
  * @since v5.0.0
224
224
  */
225
- getClientIds: (pathId: Id) => Ids;
225
+ getClientIds(pathId: Id): Ids;
226
226
  /**
227
227
  * The addPathIdsListener method registers a listener function with the
228
228
  * WsServer that will be called whenever there is a change in the active paths
@@ -282,7 +282,7 @@ export interface WsServer {
282
282
  * @category Listener
283
283
  * @since v5.0.0
284
284
  */
285
- addPathIdsListener: (listener: PathIdsListener) => Id;
285
+ addPathIdsListener(listener: PathIdsListener): Id;
286
286
  /**
287
287
  * The addClientIdsListener method registers a listener function with the
288
288
  * WsServer that will be called whenever there is a change in the clients
@@ -383,7 +383,7 @@ export interface WsServer {
383
383
  * @category Listener
384
384
  * @since v5.0.0
385
385
  */
386
- addClientIdsListener: (pathId: IdOrNull, listener: ClientIdsListener) => Id;
386
+ addClientIdsListener(pathId: IdOrNull, listener: ClientIdsListener): Id;
387
387
  /**
388
388
  * The delListener method removes a listener that was previously added to the
389
389
  * WsServer.
@@ -462,7 +462,7 @@ export interface WsServer {
462
462
  * @category Development
463
463
  * @since v5.0.0
464
464
  */
465
- getStats: () => WsServerStats;
465
+ getStats(): WsServerStats;
466
466
  /**
467
467
  * The destroy method provides a way to clean up the server at the end of its
468
468
  * use.
@@ -490,7 +490,7 @@ export interface WsServer {
490
490
  * @category Getter
491
491
  * @since v5.0.0
492
492
  */
493
- destroy: () => void;
493
+ destroy(): void;
494
494
  }
495
495
 
496
496
  /**
@@ -124,7 +124,7 @@ export interface WsServer {
124
124
  * @category Getter
125
125
  * @since v5.0.0
126
126
  */
127
- getWebSocketServer: () => WebSocketServer;
127
+ getWebSocketServer(): WebSocketServer;
128
128
  /**
129
129
  * The getPathIds method returns the active paths that the WsServer is
130
130
  * handling.
@@ -174,7 +174,7 @@ export interface WsServer {
174
174
  * @category Getter
175
175
  * @since v5.0.0
176
176
  */
177
- getPathIds: () => Ids;
177
+ getPathIds(): Ids;
178
178
  /**
179
179
  * The getClientIds method method returns the active clients that the WsServer
180
180
  * is handling for a given path.
@@ -222,7 +222,7 @@ export interface WsServer {
222
222
  * @category Getter
223
223
  * @since v5.0.0
224
224
  */
225
- getClientIds: (pathId: Id) => Ids;
225
+ getClientIds(pathId: Id): Ids;
226
226
  /**
227
227
  * The addPathIdsListener method registers a listener function with the
228
228
  * WsServer that will be called whenever there is a change in the active paths
@@ -282,7 +282,7 @@ export interface WsServer {
282
282
  * @category Listener
283
283
  * @since v5.0.0
284
284
  */
285
- addPathIdsListener: (listener: PathIdsListener) => Id;
285
+ addPathIdsListener(listener: PathIdsListener): Id;
286
286
  /**
287
287
  * The addClientIdsListener method registers a listener function with the
288
288
  * WsServer that will be called whenever there is a change in the clients
@@ -383,7 +383,7 @@ export interface WsServer {
383
383
  * @category Listener
384
384
  * @since v5.0.0
385
385
  */
386
- addClientIdsListener: (pathId: IdOrNull, listener: ClientIdsListener) => Id;
386
+ addClientIdsListener(pathId: IdOrNull, listener: ClientIdsListener): Id;
387
387
  /**
388
388
  * The delListener method removes a listener that was previously added to the
389
389
  * WsServer.
@@ -462,7 +462,7 @@ export interface WsServer {
462
462
  * @category Development
463
463
  * @since v5.0.0
464
464
  */
465
- getStats: () => WsServerStats;
465
+ getStats(): WsServerStats;
466
466
  /**
467
467
  * The destroy method provides a way to clean up the server at the end of its
468
468
  * use.
@@ -490,7 +490,7 @@ export interface WsServer {
490
490
  * @category Getter
491
491
  * @since v5.0.0
492
492
  */
493
- destroy: () => void;
493
+ destroy(): void;
494
494
  }
495
495
 
496
496
  /**
@@ -130,7 +130,7 @@ export interface WsServer {
130
130
  * @category Getter
131
131
  * @since v5.0.0
132
132
  */
133
- getWebSocketServer: () => WebSocketServer;
133
+ getWebSocketServer(): WebSocketServer;
134
134
  /**
135
135
  * The getPathIds method returns the active paths that the WsServer is
136
136
  * handling.
@@ -180,7 +180,7 @@ export interface WsServer {
180
180
  * @category Getter
181
181
  * @since v5.0.0
182
182
  */
183
- getPathIds: () => Ids;
183
+ getPathIds(): Ids;
184
184
  /**
185
185
  * The getClientIds method method returns the active clients that the WsServer
186
186
  * is handling for a given path.
@@ -228,7 +228,7 @@ export interface WsServer {
228
228
  * @category Getter
229
229
  * @since v5.0.0
230
230
  */
231
- getClientIds: (pathId: Id) => Ids;
231
+ getClientIds(pathId: Id): Ids;
232
232
  /**
233
233
  * The addPathIdsListener method registers a listener function with the
234
234
  * WsServer that will be called whenever there is a change in the active paths
@@ -288,7 +288,7 @@ export interface WsServer {
288
288
  * @category Listener
289
289
  * @since v5.0.0
290
290
  */
291
- addPathIdsListener: (listener: PathIdsListener) => Id;
291
+ addPathIdsListener(listener: PathIdsListener): Id;
292
292
  /**
293
293
  * The addClientIdsListener method registers a listener function with the
294
294
  * WsServer that will be called whenever there is a change in the clients
@@ -389,7 +389,7 @@ export interface WsServer {
389
389
  * @category Listener
390
390
  * @since v5.0.0
391
391
  */
392
- addClientIdsListener: (pathId: IdOrNull, listener: ClientIdsListener) => Id;
392
+ addClientIdsListener(pathId: IdOrNull, listener: ClientIdsListener): Id;
393
393
  /**
394
394
  * The delListener method removes a listener that was previously added to the
395
395
  * WsServer.
@@ -468,7 +468,7 @@ export interface WsServer {
468
468
  * @category Development
469
469
  * @since v5.0.0
470
470
  */
471
- getStats: () => WsServerStats;
471
+ getStats(): WsServerStats;
472
472
  /**
473
473
  * The destroy method provides a way to clean up the server at the end of its
474
474
  * use.
@@ -496,7 +496,7 @@ export interface WsServer {
496
496
  * @category Getter
497
497
  * @since v5.0.0
498
498
  */
499
- destroy: () => void;
499
+ destroy(): void;
500
500
  }
501
501
 
502
502
  /**
@@ -130,7 +130,7 @@ export interface WsServer {
130
130
  * @category Getter
131
131
  * @since v5.0.0
132
132
  */
133
- getWebSocketServer: () => WebSocketServer;
133
+ getWebSocketServer(): WebSocketServer;
134
134
  /**
135
135
  * The getPathIds method returns the active paths that the WsServer is
136
136
  * handling.
@@ -180,7 +180,7 @@ export interface WsServer {
180
180
  * @category Getter
181
181
  * @since v5.0.0
182
182
  */
183
- getPathIds: () => Ids;
183
+ getPathIds(): Ids;
184
184
  /**
185
185
  * The getClientIds method method returns the active clients that the WsServer
186
186
  * is handling for a given path.
@@ -228,7 +228,7 @@ export interface WsServer {
228
228
  * @category Getter
229
229
  * @since v5.0.0
230
230
  */
231
- getClientIds: (pathId: Id) => Ids;
231
+ getClientIds(pathId: Id): Ids;
232
232
  /**
233
233
  * The addPathIdsListener method registers a listener function with the
234
234
  * WsServer that will be called whenever there is a change in the active paths
@@ -288,7 +288,7 @@ export interface WsServer {
288
288
  * @category Listener
289
289
  * @since v5.0.0
290
290
  */
291
- addPathIdsListener: (listener: PathIdsListener) => Id;
291
+ addPathIdsListener(listener: PathIdsListener): Id;
292
292
  /**
293
293
  * The addClientIdsListener method registers a listener function with the
294
294
  * WsServer that will be called whenever there is a change in the clients
@@ -389,7 +389,7 @@ export interface WsServer {
389
389
  * @category Listener
390
390
  * @since v5.0.0
391
391
  */
392
- addClientIdsListener: (pathId: IdOrNull, listener: ClientIdsListener) => Id;
392
+ addClientIdsListener(pathId: IdOrNull, listener: ClientIdsListener): Id;
393
393
  /**
394
394
  * The delListener method removes a listener that was previously added to the
395
395
  * WsServer.
@@ -468,7 +468,7 @@ export interface WsServer {
468
468
  * @category Development
469
469
  * @since v5.0.0
470
470
  */
471
- getStats: () => WsServerStats;
471
+ getStats(): WsServerStats;
472
472
  /**
473
473
  * The destroy method provides a way to clean up the server at the end of its
474
474
  * use.
@@ -496,7 +496,7 @@ export interface WsServer {
496
496
  * @category Getter
497
497
  * @since v5.0.0
498
498
  */
499
- destroy: () => void;
499
+ destroy(): void;
500
500
  }
501
501
 
502
502
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "5.2.0-beta.5",
3
+ "version": "5.3.0-beta.0",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",
@@ -21,10 +21,10 @@
21
21
  "sideEffects": false,
22
22
  "peerDependencies": {
23
23
  "@automerge/automerge-repo": "^1.2.0",
24
- "@electric-sql/pglite": "^0.2.4",
24
+ "@electric-sql/pglite": "^0.2.5",
25
25
  "@libsql/client": "^0.10.0",
26
26
  "@powersync/common": "^1.16.2",
27
- "@sqlite.org/sqlite-wasm": "^3.46.1-build1",
27
+ "@sqlite.org/sqlite-wasm": "^3.46.1-build2",
28
28
  "@vlcn.io/crsqlite-wasm": "^0.16.0",
29
29
  "electric-sql": "^0.12.1",
30
30
  "expo": "^51.0.0",