Skip to content

Commit 84cce2d

Browse files
committed
Separating out accessing sqlite storage from kv
storage. Fixing links to accommodate this change
1 parent f89c7aa commit 84cce2d

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

public/_redirects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
/durable-objects/api/websockets/ /durable-objects/features/websockets/ 301
402402
/durable-objects/best-practices/ /durable-objects/features/ 301
403403
/durable-objects/best-practices/create-durable-object-stubs-and-send-requests/ /durable-objects/features/create-durable-object-stubs-and-send-requests/ 301
404-
/durable-objects/best-practices/access-durable-objects-storage/ /durable-objects/features/access-durable-objects-storage/ 301
404+
/durable-objects/best-practices/access-durable-objects-storage/ /durable-objects/features/access-sqlite-storage/ 301
405405
/durable-objects/best-practices/error-handling/ /durable-objects/features/error-handling/ 301
406406
/durable-objects/best-practices/websockets/ /durable-objects/features/websockets/ 301
407407
/durable-objects/platform/data-location/ /durable-objects/reference/data-location/ 301

src/content/docs/durable-objects/api/sql-storage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ SQL API methods accessed with `ctx.storage.sql` are only allowed on [Durable Obj
3838
:::
3939

4040
:::note[Writing to indexes or virtual tables]
41-
When writing data, every index counts as an additional row. However, indexes may be beneficial for read-heavy use cases. Refer to [Index for SQLite Durable Objects](/durable-objects/features/access-durable-objects-storage/#index-for-sqlite-durable-objects).
41+
When writing data, every index counts as an additional row. However, indexes may be beneficial for read-heavy use cases. Refer to [Index for SQLite Durable Objects](/durable-objects/features/access-sqlite-storage/#index-for-sqlite-durable-objects).
4242

4343
Writing data to [SQLite virtual tables](https://www.sqlite.org/vtab.html) also counts towards rows written.
4444
:::

src/content/docs/durable-objects/api/storage-api.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ export class Counter extends DurableObject {
5252
## Methods
5353

5454
:::note[SQLite in Durable Objects]
55-
SQLite-backed Durable Objects can have a private, embedded SQLite database. When deploying a new Durable Object class, users can [use a SQLite storage backend](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend) to access the [SQL API](/durable-objects/api/sql-storage/#exec).
55+
SQLite-backed Durable Objects can have a private, embedded SQLite database. When deploying a new Durable Object class, users can [use a SQLite storage backend](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend) to access the [SQL API](/durable-objects/api/sql-storage/#exec).
5656

5757
Otherwise, a Durable Object class has a key-value storage backend.
5858
:::
5959

6060
The Durable Object Storage API comes with several methods, including key-value (KV) API, SQL API, and point-in-time-recovery (PITR) API.
6161

6262
- Durable Object classes with the default, key-value storage backend can use KV API.
63-
- Durable Object classes with the [SQLite storage backend](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend) can use KV API, SQL API, and PITR API. KV API methods like `get()`, `put()`, `delete()`, or `list()` store data in a hidden SQLite table.
63+
- Durable Object classes with the [SQLite storage backend](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend) can use KV API, SQL API, and PITR API. KV API methods like `get()`, `put()`, `delete()`, or `list()` store data in a hidden SQLite table.
6464

6565
Each method is implicitly wrapped inside a transaction, such that its results are atomic and isolated from all other storage operations, even when accessing multiple key-value pairs.
6666

@@ -110,7 +110,7 @@ Each method is implicitly wrapped inside a transaction, such that its results ar
110110

111111
- <code>deleteAll(options <Type text="Object" /> <MetaInfo text="optional" />)</code>: <Type text="Promise" />
112112

113-
- Deletes all stored data, effectively deallocating all storage used by the Durable Object. For Durable Objects with a key-value storage backend, `deleteAll()` removes all keys and associated values for an individual Durable Object. For Durable Objects with a [SQLite storage backend](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend), `deleteAll()` removes the entire contents of a Durable Object's private SQLite database, including both SQL data and key-value data.
113+
- Deletes all stored data, effectively deallocating all storage used by the Durable Object. For Durable Objects with a key-value storage backend, `deleteAll()` removes all keys and associated values for an individual Durable Object. For Durable Objects with a [SQLite storage backend](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend), `deleteAll()` removes the entire contents of a Durable Object's private SQLite database, including both SQL data and key-value data.
114114
- For Durable Objects with a key-value storage backend, an in-progress `deleteAll()` operation can fail, which may leave a subset of data undeleted. Durable Objects with a SQLite storage backend do not have a partial `deleteAll()` issue because `deleteAll()` operations are atomic (all or nothing).
115115
- `deleteAll()` does not proactively delete [Alarms](/durable-objects/api/alarms/). Use [`deleteAlarm()`](/durable-objects/api/alarms/#deletealarm) to delete an alarm.
116116

@@ -203,13 +203,13 @@ The `put()` method returns a `Promise`, but most applications can discard this p
203203

204204
- Provides access to the `put()`, `get()`, `delete()` and `list()` methods documented above to run in the current transaction context. In order to get transactional behavior within a transaction closure, you must call the methods on the `txn` Object instead of on the top-level `ctx.storage` Object.<br/><br/>Also supports a `rollback()` function that ensures any changes made during the transaction will be rolled back rather than committed. After `rollback()` is called, any subsequent operations on the `txn` Object will fail with an exception. `rollback()` takes no parameters and returns nothing to the caller.
205205

206-
* When using [the SQLite-backed storage engine](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend), the `txn` object is obsolete. Any storage operations performed directly on the `ctx.storage` object, including SQL queries using [`ctx.storage.sql.exec()`](/durable-objects/api/sql-storage/#exec), will be considered part of the transaction.
206+
* When using [the SQLite-backed storage engine](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend), the `txn` object is obsolete. Any storage operations performed directly on the `ctx.storage` object, including SQL queries using [`ctx.storage.sql.exec()`](/durable-objects/api/sql-storage/#exec), will be considered part of the transaction.
207207

208208
### `transactionSync`
209209

210210
- `transactionSync(callback)`: <Type text='any' />
211211

212-
- Only available when using [the SQLite-backed storage engine](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend).
212+
- Only available when using [the SQLite-backed storage engine](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend).
213213

214214
- Invokes `callback()` wrapped in a transaction, and returns its result.
215215

File renamed without changes.

src/content/docs/durable-objects/platform/limits.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Durable Objects have limits.
4646

4747
## SQLite Durable Object SQL limits
4848

49-
For Durable Object classes with [SQLite storage backend](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend) these SQL limits apply:
49+
For Durable Object classes with [SQLite storage backend](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend) these SQL limits apply:
5050

5151
| SQL | Limit |
5252
| -------------------------------------------------------- | ----------------------------------------------- |

src/content/docs/durable-objects/tutorials/build-a-seat-booking-app/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ languages:
1212

1313
import { Render, PackageManagers, Details, WranglerConfig } from "~/components";
1414

15-
In this tutorial, you will learn how to build a seat reservation app using Durable Objects. This app will allow users to book a seat for a flight. The app will be written in TypeScript and will use the new [SQLite storage backend in Durable Object](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend) to store the data.
15+
In this tutorial, you will learn how to build a seat reservation app using Durable Objects. This app will allow users to book a seat for a flight. The app will be written in TypeScript and will use the new [SQLite storage backend in Durable Object](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend) to store the data.
1616

1717
Using Durable Objects, you can write reusable code that can handle coordination and state management for multiple clients. Moreover, writing data to SQLite in Durable Objects is synchronous and uses local disks, therefore all queries are executed with great performance. You can learn more about SQLite storage in Durable Objects in the [SQLite in Durable Objects blog post](https://blog.cloudflare.com/sqlite-in-durable-objects).
1818

1919
:::note[SQLite in Durable Objects]
2020

21-
SQLite in Durable Objects is currently in beta. You can learn more about the limitations of SQLite in Durable Objects in the [SQLite in Durable Objects documentation](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend).
21+
SQLite in Durable Objects is currently in beta. You can learn more about the limitations of SQLite in Durable Objects in the [SQLite in Durable Objects documentation](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend).
2222

2323
:::
2424

src/content/glossary/durable-objects.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ entries:
2727
2828
- term: "Storage Backend"
2929
general_definition: |-
30-
By default, a Durable Object class can use Storage API that leverages a key-value storage backend. New Durable Object classes can opt-in to using a [SQLite storage backend](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend).
30+
By default, a Durable Object class can use Storage API that leverages a key-value storage backend. New Durable Object classes can opt-in to using a [SQLite storage backend](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend).
3131
3232
- term: "Storage API"
3333
general_definition: |-

src/content/partials/durable-objects/durable-objects-vs-d1.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## SQL in Durable Objects vs D1
66

7-
Cloudflare Workers offers a SQLite-backed serverless database product - [D1](/d1/). How should you compare [SQLite in Durable Objects](/durable-objects/features/access-durable-objects-storage/#sql-storage) and D1?
7+
Cloudflare Workers offers a SQLite-backed serverless database product - [D1](/d1/). How should you compare [SQLite in Durable Objects](/durable-objects/features/access-sqlite-storage/) and D1?
88

99
**D1 is a managed database product.**
1010

src/content/release-notes/durable-objects.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ entries:
1616
- publish_date: "2024-10-07"
1717
title: Alarms re-enabled in (beta) SQLite-backed Durable Object classes
1818
description: |-
19-
The issue identified with [alarms](/durable-objects/api/alarms/) in [beta Durable Object classes with a SQLite storage backend](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend) has been resolved and alarms have been re-enabled.
19+
The issue identified with [alarms](/durable-objects/api/alarms/) in [beta Durable Object classes with a SQLite storage backend](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend) has been resolved and alarms have been re-enabled.
2020
2121
- publish_date: "2024-09-27"
2222
title: Alarms disabled in (beta) SQLite-backed Durable Object classes
2323
description: |-
24-
An issue was identified with [alarms](/durable-objects/api/alarms/) in [beta Durable Object classes with a SQLite storage backend](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend). Alarms have been temporarily disabled for only SQLite-backed Durable Objects while a fix is implemented. Alarms in Durable Objects with default, key-value storage backend are unaffected and continue to operate.
24+
An issue was identified with [alarms](/durable-objects/api/alarms/) in [beta Durable Object classes with a SQLite storage backend](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend). Alarms have been temporarily disabled for only SQLite-backed Durable Objects while a fix is implemented. Alarms in Durable Objects with default, key-value storage backend are unaffected and continue to operate.
2525
2626
- publish_date: "2024-09-26"
2727
title: (Beta) SQLite storage backend & SQL API available on new Durable Object classes
2828
description: |-
29-
The new beta version of Durable Objects is available where each Durable Object has a private, embedded SQLite database. When deploying a new Durable Object class, users can [opt-in to a SQLite storage backend](/durable-objects/features/access-durable-objects-storage/#sqlite-storage-backend) in order to access new [SQL API](/durable-objects/api/sql-storage/#exec) and [point-in-time-recovery API](/durable-objects/api/sql-storage/#point-in-time-recovery), part of Durable Objects Storage API.
29+
The new beta version of Durable Objects is available where each Durable Object has a private, embedded SQLite database. When deploying a new Durable Object class, users can [opt-in to a SQLite storage backend](/durable-objects/features/access-sqlite-storage/#sqlite-storage-backend) in order to access new [SQL API](/durable-objects/api/sql-storage/#exec) and [point-in-time-recovery API](/durable-objects/api/sql-storage/#point-in-time-recovery), part of Durable Objects Storage API.
3030
3131
You cannot enable a SQLite storage backend on an existing, deployed Durable Object class. Automatic migration of deployed classes from their key-value storage backend to SQLite storage backend will be available in the future.
3232

0 commit comments

Comments
 (0)