Skip to content

Commit cb3c77a

Browse files
committed
v9.0.0-beta.0
1 parent 6dd3963 commit cb3c77a

288 files changed

Lines changed: 2705 additions & 8032 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tests":8616,"assertions":35848,"lines":{"total":4452,"covered":4452,"skipped":0,"pct":100},"statements":{"total":4833,"covered":4833,"skipped":0,"pct":100},"functions":{"total":2183,"covered":2183,"skipped":0,"pct":100},"branches":{"total":1359,"covered":1359,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
1+
{"tests":8620,"assertions":35861,"lines":{"total":4452,"covered":4452,"skipped":0,"pct":100},"statements":{"total":4833,"covered":4833,"skipped":0,"pct":100},"functions":{"total":2183,"covered":2183,"skipped":0,"pct":100},"branches":{"total":1359,"covered":1359,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}

docs/api/all.html

Lines changed: 37 additions & 19 deletions
Large diffs are not rendered by default.

docs/api/persister-durable-object-sql-storage/functions/creation/createdurableobjectsqlstoragepersister/article.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<span class="punctuation">}</span>
1616
<span class="punctuation">]</span>
1717
<span class="punctuation">}</span>
18-
</code></pre><p>For more details on Durable Object migrations, see the <a href="https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/">Cloudflare documentation</a>.</p><p>A database <a href="/api/the-essentials/persisting-stores/persister/"><code>Persister</code></a> uses one of two modes: either a JSON serialization of the whole <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> stored in a single row of a table (the default), a fragmented mode that stores each piece of data separately to avoid Cloudflare&#x27;s 2MB row limit.</p><ul><li><p><strong>JSON Mode (Default)</strong>: Stores the entire <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> as JSON in a single database row. This is efficient for smaller stores but may hit Cloudflare&#x27;s 2MB row limit for very large stores and uses fewer database writes.</p></li><li><p><strong>Fragmented Mode</strong>: Stores each table, row, cell, and value as separate database rows. Use this mode if you&#x27;re concerned about hitting Cloudflare&#x27;s 2MB row limit with large stores in JSON mode. This mode creates more database writes but avoids row size limitations.</p></li></ul><p>The third argument is a <a href="/api/persisters/type-aliases/configuration/databasepersisterconfig/"><code>DatabasePersisterConfig</code></a> object that configures which of those modes to use, and settings for each. If the third argument is simply a string, it is used as the <code>storeTableName</code> property of the JSON serialization. If it is the string &#x27;fragmented&#x27;, it enables fragmented mode.</p><p>See the documentation for the <a href="/api/persisters/type-aliases/configuration/dpcjson/"><code>DpcJson</code></a>, <a href="/api/persister-durable-object-sql-storage/type-aliases/configuration/dpcfragmented/"><code>DpcFragmented</code></a>, and <a href="/api/persisters/type-aliases/configuration/dpctabular/"><code>DpcTabular</code></a> types for more information on how all of those modes can be configured.</p><p>Note: When using tabular mode, SQL NULL values are loaded as TinyBase null values, making tables dense (every <a href="/api/store/type-aliases/store/row/"><code>Row</code></a> has every <a href="/api/store/type-aliases/store/cell/"><code>Cell</code></a>). See the <a href="/guides/persistence/database-persistence/">Database Persistence</a> guide for details.</p><p>As well as providing a reference to the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> or <a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> to persist, you must provide a <code>sqlStorage</code> parameter which identifies the Durable Object SQLite storage to persist it to.</p><section class="s2"><h2>Examples</h2><p>This example creates a <a href="/api/persister-durable-object-sql-storage/interfaces/persister/durableobjectsqlstoragepersister/"><code>DurableObjectSqlStoragePersister</code></a> object and persists the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> to Durable Object SQLite storage as a JSON serialization into the default <code>tinybase</code> table. It uses this within the <a href="/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/methods/creation/createpersister/"><code>createPersister</code></a> method of a <a href="/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/"><code>WsServerDurableObject</code></a> instance.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createMergeableStore<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase'</span><span class="punctuation">;</span>
18+
</code></pre><p>For more details on Durable Object migrations, see the <a href="https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/">Cloudflare documentation</a>.</p><p>A database <a href="/api/the-essentials/persisting-stores/persister/"><code>Persister</code></a> uses one of two modes: either a JSON serialization of the whole <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> stored in a single row of a table (the default), a fragmented mode that stores each piece of data separately to avoid Cloudflare&#x27;s 2MB row limit.</p><ul><li><p><strong>JSON Mode (Default)</strong>: Stores the entire <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> as JSON in a single database row. This is efficient for smaller stores but may hit Cloudflare&#x27;s 2MB row limit for very large stores and uses fewer database writes.</p></li><li><p><strong>Fragmented Mode</strong>: Stores each table&#x27;s metadata, row data, and values as separate database rows. Use this mode if you&#x27;re concerned about hitting Cloudflare&#x27;s 2MB row limit with large stores in JSON mode. This mode creates more database writes than JSON mode but avoids row size limitations.</p></li></ul><p>The third argument is a <a href="/api/persisters/type-aliases/configuration/databasepersisterconfig/"><code>DatabasePersisterConfig</code></a> object that configures which of those modes to use, and settings for each. If the third argument is simply a string, it is used as the <code>storeTableName</code> property of the JSON serialization. If it is the string &#x27;fragmented&#x27;, it enables fragmented mode.</p><p>See the documentation for the <a href="/api/persisters/type-aliases/configuration/dpcjson/"><code>DpcJson</code></a>, <a href="/api/persister-durable-object-sql-storage/type-aliases/configuration/dpcfragmented/"><code>DpcFragmented</code></a>, and <a href="/api/persisters/type-aliases/configuration/dpctabular/"><code>DpcTabular</code></a> types for more information on how all of those modes can be configured.</p><p>Note: When using tabular mode, SQL NULL values are loaded as TinyBase null values, making tables dense (every <a href="/api/store/type-aliases/store/row/"><code>Row</code></a> has every <a href="/api/store/type-aliases/store/cell/"><code>Cell</code></a>). See the <a href="/guides/persistence/database-persistence/">Database Persistence</a> guide for details.</p><p>As well as providing a reference to the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> or <a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> to persist, you must provide a <code>sqlStorage</code> parameter which identifies the Durable Object SQLite storage to persist it to.</p><section class="s2"><h2>Examples</h2><p>This example creates a <a href="/api/persister-durable-object-sql-storage/interfaces/persister/durableobjectsqlstoragepersister/"><code>DurableObjectSqlStoragePersister</code></a> object and persists the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> to Durable Object SQLite storage as a JSON serialization into the default <code>tinybase</code> table. It uses this within the <a href="/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/methods/creation/createpersister/"><code>createPersister</code></a> method of a <a href="/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/"><code>WsServerDurableObject</code></a> instance.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createMergeableStore<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase'</span><span class="punctuation">;</span>
1919
<span class="keyword">import</span> <span class="punctuation">{</span>createDurableObjectSqlStoragePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-durable-object-sql-storage'</span><span class="punctuation">;</span>
2020
<span class="keyword">import</span> <span class="punctuation">{</span>WsServerDurableObject<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/synchronizers/synchronizer-ws-server-durable-object'</span><span class="punctuation">;</span>
2121

docs/api/persister-durable-object-sql-storage/functions/creation/createdurableobjectsqlstoragepersister/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<span class="punctuation">}</span>
1616
<span class="punctuation">]</span>
1717
<span class="punctuation">}</span>
18-
</code></pre><p>For more details on Durable Object migrations, see the <a href="https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/">Cloudflare documentation</a>.</p><p>A database <a href="/api/the-essentials/persisting-stores/persister/"><code>Persister</code></a> uses one of two modes: either a JSON serialization of the whole <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> stored in a single row of a table (the default), a fragmented mode that stores each piece of data separately to avoid Cloudflare&#x27;s 2MB row limit.</p><ul><li><p><strong>JSON Mode (Default)</strong>: Stores the entire <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> as JSON in a single database row. This is efficient for smaller stores but may hit Cloudflare&#x27;s 2MB row limit for very large stores and uses fewer database writes.</p></li><li><p><strong>Fragmented Mode</strong>: Stores each table, row, cell, and value as separate database rows. Use this mode if you&#x27;re concerned about hitting Cloudflare&#x27;s 2MB row limit with large stores in JSON mode. This mode creates more database writes but avoids row size limitations.</p></li></ul><p>The third argument is a <a href="/api/persisters/type-aliases/configuration/databasepersisterconfig/"><code>DatabasePersisterConfig</code></a> object that configures which of those modes to use, and settings for each. If the third argument is simply a string, it is used as the <code>storeTableName</code> property of the JSON serialization. If it is the string &#x27;fragmented&#x27;, it enables fragmented mode.</p><p>See the documentation for the <a href="/api/persisters/type-aliases/configuration/dpcjson/"><code>DpcJson</code></a>, <a href="/api/persister-durable-object-sql-storage/type-aliases/configuration/dpcfragmented/"><code>DpcFragmented</code></a>, and <a href="/api/persisters/type-aliases/configuration/dpctabular/"><code>DpcTabular</code></a> types for more information on how all of those modes can be configured.</p><p>Note: When using tabular mode, SQL NULL values are loaded as TinyBase null values, making tables dense (every <a href="/api/store/type-aliases/store/row/"><code>Row</code></a> has every <a href="/api/store/type-aliases/store/cell/"><code>Cell</code></a>). See the <a href="/guides/persistence/database-persistence/">Database Persistence</a> guide for details.</p><p>As well as providing a reference to the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> or <a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> to persist, you must provide a <code>sqlStorage</code> parameter which identifies the Durable Object SQLite storage to persist it to.</p><section class="s2"><h2>Examples</h2><p>This example creates a <a href="/api/persister-durable-object-sql-storage/interfaces/persister/durableobjectsqlstoragepersister/"><code>DurableObjectSqlStoragePersister</code></a> object and persists the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> to Durable Object SQLite storage as a JSON serialization into the default <code>tinybase</code> table. It uses this within the <a href="/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/methods/creation/createpersister/"><code>createPersister</code></a> method of a <a href="/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/"><code>WsServerDurableObject</code></a> instance.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createMergeableStore<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase'</span><span class="punctuation">;</span>
18+
</code></pre><p>For more details on Durable Object migrations, see the <a href="https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/">Cloudflare documentation</a>.</p><p>A database <a href="/api/the-essentials/persisting-stores/persister/"><code>Persister</code></a> uses one of two modes: either a JSON serialization of the whole <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> stored in a single row of a table (the default), a fragmented mode that stores each piece of data separately to avoid Cloudflare&#x27;s 2MB row limit.</p><ul><li><p><strong>JSON Mode (Default)</strong>: Stores the entire <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> as JSON in a single database row. This is efficient for smaller stores but may hit Cloudflare&#x27;s 2MB row limit for very large stores and uses fewer database writes.</p></li><li><p><strong>Fragmented Mode</strong>: Stores each table&#x27;s metadata, row data, and values as separate database rows. Use this mode if you&#x27;re concerned about hitting Cloudflare&#x27;s 2MB row limit with large stores in JSON mode. This mode creates more database writes than JSON mode but avoids row size limitations.</p></li></ul><p>The third argument is a <a href="/api/persisters/type-aliases/configuration/databasepersisterconfig/"><code>DatabasePersisterConfig</code></a> object that configures which of those modes to use, and settings for each. If the third argument is simply a string, it is used as the <code>storeTableName</code> property of the JSON serialization. If it is the string &#x27;fragmented&#x27;, it enables fragmented mode.</p><p>See the documentation for the <a href="/api/persisters/type-aliases/configuration/dpcjson/"><code>DpcJson</code></a>, <a href="/api/persister-durable-object-sql-storage/type-aliases/configuration/dpcfragmented/"><code>DpcFragmented</code></a>, and <a href="/api/persisters/type-aliases/configuration/dpctabular/"><code>DpcTabular</code></a> types for more information on how all of those modes can be configured.</p><p>Note: When using tabular mode, SQL NULL values are loaded as TinyBase null values, making tables dense (every <a href="/api/store/type-aliases/store/row/"><code>Row</code></a> has every <a href="/api/store/type-aliases/store/cell/"><code>Cell</code></a>). See the <a href="/guides/persistence/database-persistence/">Database Persistence</a> guide for details.</p><p>As well as providing a reference to the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> or <a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> to persist, you must provide a <code>sqlStorage</code> parameter which identifies the Durable Object SQLite storage to persist it to.</p><section class="s2"><h2>Examples</h2><p>This example creates a <a href="/api/persister-durable-object-sql-storage/interfaces/persister/durableobjectsqlstoragepersister/"><code>DurableObjectSqlStoragePersister</code></a> object and persists the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> to Durable Object SQLite storage as a JSON serialization into the default <code>tinybase</code> table. It uses this within the <a href="/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/methods/creation/createpersister/"><code>createPersister</code></a> method of a <a href="/api/synchronizer-ws-server-durable-object/classes/creation/wsserverdurableobject/"><code>WsServerDurableObject</code></a> instance.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createMergeableStore<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase'</span><span class="punctuation">;</span>
1919
<span class="keyword">import</span> <span class="punctuation">{</span>createDurableObjectSqlStoragePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-durable-object-sql-storage'</span><span class="punctuation">;</span>
2020
<span class="keyword">import</span> <span class="punctuation">{</span>WsServerDurableObject<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/synchronizers/synchronizer-ws-server-durable-object'</span><span class="punctuation">;</span>
2121

0 commit comments

Comments
 (0)