@@ -5,6 +5,55 @@ highlighted features.
55
66---
77
8+ # v6.3
9+
10+ This release includes the new persister-durable-object-sql-storage module, which
11+ allows you to persist data in a Cloudflare Durable Object's SQLite-based storage
12+ in conjunction with websocket-based synchronization (using the
13+ WsServerDurableObject class).
14+
15+ ``` js yolo
16+ import {createMergeableStore } from ' tinybase' ;
17+ import {createDurableObjectSqlStoragePersister } from ' tinybase/persisters/persister-durable-object-sql-storage' ;
18+ import {WsServerDurableObject } from ' tinybase/synchronizers/synchronizer-ws-server-durable-object' ;
19+
20+ const config = {
21+ mode: ' fragmented' ,
22+ storagePrefix: ' my_app_' ,
23+ };
24+
25+ export class MyDurableObject extends WsServerDurableObject {
26+ createPersister () {
27+ const store = createMergeableStore ();
28+ const persister = createDurableObjectSqlStoragePersister (
29+ store,
30+ this .ctx .storage .sql ,
31+ config,
32+ );
33+ return persister;
34+ }
35+ }
36+ ```
37+
38+ Prior to this release, the only way to persist data in a Durable Object was to
39+ use the persister-durable-object-storage module, which uses CloudFlare's
40+ key-value storage backend behind the scenes.
41+
42+ However, Cloudflare's SQLite storage backend for Durable Objects offers
43+ significantly better pricing compared to the key-value storage backend. The
44+ SQLite storage backend is Cloudflare's recommended storage option for new
45+ Durable Object namespaces.
46+
47+ Note that, before using this persister, you must configure your Durable Object
48+ class to use SQLite storage by adding a migration to your ` wrangler.toml ` or
49+ ` wrangler.json ` configuration file. Use ` new_sqlite_classes ` in your migration
50+ configuration to enable SQLite storage for your Durable Object class. See the
51+ module documentation for more information.
52+
53+ This release also addresses a local-storage persistence issue, #[ 257] ( https://github.com/tinyplex/tinybase/issues/257 ) .
54+
55+ ---
56+
857# v6.2
958
1059This release contains various packaging improvements and exposes some internal
@@ -60,6 +109,8 @@ generated in TinyBase MergeableStore objects.
60109The rarely-used GetNow and Hash types have been moved from the mergeable-store
61110module into the common module.
62111
112+ ---
113+
63114# v6.1
64115
65116## In Summary
@@ -188,6 +239,8 @@ base Persister interface have been marked asynchronous and return Promises. The
188239stopSync method in the Synchronizer interface and the destroy method in the
189240Synchronizer server interfaces should also be considered asynchronous.
190241
242+ ---
243+
191244# v6.0
192245
193246This major release is about updating dependencies and infrastructure rather than
@@ -225,6 +278,8 @@ to upgrade as soon as you can.
225278Please let us know how these changes find you, and please file an issue on
226279GitHub if you need help adapting to any of them.
227280
281+ ---
282+
228283# v5.4
229284
230285## Durable Objects synchronization
0 commit comments