Skip to content

Commit 7ec7875

Browse files
committed
Fixing links
1 parent c21989f commit 7ec7875

27 files changed

+43
-66
lines changed

public/__redirects

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@
516516
/durable-objects/api/hibernatable-websockets-api/ /durable-objects/best-practices/websockets/ 301
517517
/durable-objects/api/alarms-in-durable-objects/ /durable-objects/api/alarms/ 301
518518
/durable-objects/api/websockets/ /durable-objects/best-practices/websockets/ 301
519-
/durable-objects/api/sql-storage/ /durable-objects/api/storage-api/ 301
519+
/durable-objects/api/sql-storage/ /durable-objects/api/sqlite-storage-api/ 301
520520
/durable-objects/platform/data-location/ /durable-objects/reference/data-location/ 301
521521
/durable-objects/platform/environments/ /durable-objects/reference/environments/ 301
522522
/durable-objects/platform/troubleshooting/ /durable-objects/observability/troubleshooting/ 301
@@ -531,7 +531,7 @@
531531
/durable-objects/reference/error-handling/ /durable-objects/best-practices/error-handling/ 301
532532
/durable-objects/reference/troubleshooting/ /durable-objects/observability/troubleshooting/ 301
533533
/durable-objects/reference/websockets/ /durable-objects/best-practices/websockets/ 301
534-
/durable-objects/api/transactional-storage-api/ /durable-objects/api/storage-api/ 301
534+
/durable-objects/api/transactional-storage-api/ /durable-objects/api/sqlite-storage-api/ 301
535535
/durable-objects/platform/changelog/ /durable-objects/release-notes/ 301
536536
/durable-objects/changelog/ /durable-objects/release-notes/ 301
537537
/durable-objects/glossary/ /durable-objects/reference/glossary/ 301
@@ -549,6 +549,7 @@
549549
/durable-objects/get-started/video-series/ /durable-objects/video-tutorials/ 301
550550

551551
/durable-objects/what-are-durable-objects/ /durable-objects/concepts/what-are-durable-objects/ 301
552+
/durable-objects/api/storage-api /durable-objects/api/sqlite-storage-api/ 301
552553

553554
# email-routing
554555
/email-routing/enable-email-routing/ /email-routing/get-started/enable-email-routing/ 301

src/content/changelog/durable-objects/2025-04-07-sqlite-in-durable-objects-ga.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ date: 2025-04-07
99

1010
SQLite in Durable Objects is now generally available (GA) with 10GB SQLite database per Durable Object. Since the [public beta](https://blog.cloudflare.com/sqlite-in-durable-objects/) in September 2024, we've added feature parity and robustness for the SQLite storage backend compared to the preexisting key-value (KV) storage backend for Durable Objects.
1111

12-
SQLite-backed Durable Objects are recommended for all new Durable Object classes, using `new_sqlite_classes` [Wrangler configuration](/durable-objects/best-practices/access-durable-objects-storage/#create-sqlite-backed-durable-object-class). Only SQLite-backed Durable Objects have access to Storage API's [SQL](/durable-objects/api/storage-api/#sql-api) and [point-in-time recovery](/durable-objects/api/storage-api/#pitr-point-in-time-recovery-api) methods, which provide relational data modeling, SQL querying, and better data management.
12+
SQLite-backed Durable Objects are recommended for all new Durable Object classes, using `new_sqlite_classes` [Wrangler configuration](/durable-objects/best-practices/access-durable-objects-storage/#create-sqlite-backed-durable-object-class). Only SQLite-backed Durable Objects have access to Storage API's [SQL](/durable-objects/api/sqlite-storage-api/#sql-api) and [point-in-time recovery](/durable-objects/api/sqlite-storage-api/#pitr-point-in-time-recovery-api) methods, which provide relational data modeling, SQL querying, and better data management.
1313

1414
```js
1515
export class MyDurableObject extends DurableObject {

src/content/docs/agents/api-reference/schedule-tasks.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Calling `await this.schedule` returns a `Schedule`, which includes the task's ra
7070

7171
:::note[Maximum scheduled tasks]
7272

73-
Each task is mapped to a row in the Agent's underlying [SQLite database](/durable-objects/api/storage-api/), which means that each task can be up to 2 MB in size. The maximum number of tasks must be `(task_size * tasks) + all_other_state < maximum_database_size` (currently 1GB per Agent).
73+
Each task is mapped to a row in the Agent's underlying [SQLite database](/durable-objects/api/sqlite-storage-api/), which means that each task can be up to 2 MB in size. The maximum number of tasks must be `(task_size * tasks) + all_other_state < maximum_database_size` (currently 1GB per Agent).
7474

7575
:::
7676

src/content/docs/agents/api-reference/store-and-sync-state.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Learn more about the zero-latency SQL storage that powers both Agents and Durabl
227227

228228
:::
229229

230-
The SQL API exposed to an Agent is similar to the one [within Durable Objects](/durable-objects/api/storage-api/#sql-api): Durable Object SQL methods available on `this.ctx.storage.sql`. You can use the same SQL queries with the Agent's database, create tables, and query data, just as you would with Durable Objects or [D1](/d1/).
230+
The SQL API exposed to an Agent is similar to the one [within Durable Objects](/durable-objects/api/sqlite-storage-api/#sql-api): Durable Object SQL methods available on `this.ctx.storage.sql`. You can use the same SQL queries with the Agent's database, create tables, and query data, just as you would with Durable Objects or [D1](/d1/).
231231

232232
### Use Agent state as model context
233233

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,4 @@ class MyDurableObject extends DurableObject {
133133
134134
- Understand how to [use the Alarms API](/durable-objects/examples/alarms-api/) in an end-to-end example.
135135
- Read the [Durable Objects alarms announcement blog post](https://blog.cloudflare.com/durable-objects-alarms/).
136-
- Review the [Storage API](/durable-objects/api/storage-api/) documentation for Durable Objects.
136+
- Review the [Storage API](/durable-objects/api/sqlite-storage-api/) documentation for Durable Objects.

src/content/docs/durable-objects/api/legacy-kv-backed-storage.mdx renamed to src/content/docs/durable-objects/api/legacy-kv-storage-api.mdx

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,30 +52,7 @@ KV-backed Durable Objects use KV API methods which are asynchronous.
5252

5353
## Alarms
5454

55-
### `getAlarm`
56-
57-
- <code>getAlarm(options <Type text="Object" /> <MetaInfo text="optional" />)</code>: <Type text="Promise<Number | null>" />
58-
- Retrieves the current alarm time (if set) as integer milliseconds since epoch. The alarm is considered to be set if it has not started, or if it has failed and any retry has not begun. If no alarm is set, `getAlarm()` returns `null`.
59-
60-
#### Supported options
61-
62-
- Same options as [`get()`](/durable-objects/api/storage-api/#get), but without `noCache`.
63-
64-
### `setAlarm`
65-
66-
- <code>setAlarm(scheduledTime <Type text="Date | number" />, options <Type text="Object" /> <MetaInfo text="optional" />)</code>: <Type text="Promise" />
67-
- Sets the current alarm time, accepting either a JavaScript `Date`, or integer milliseconds since epoch.
68-
69-
If `setAlarm()` is called with a time equal to or before `Date.now()`, the alarm will be scheduled for asynchronous execution in the immediate future. If the alarm handler is currently executing in this case, it will not be canceled. Alarms can be set to millisecond granularity and will usually execute within a few milliseconds after the set time, but can be delayed by up to a minute due to maintenance or failures while failover takes place.
70-
71-
### `deleteAlarm`
72-
73-
- <code>deleteAlarm(options <Type text="Object" /> <MetaInfo text="optional" />)</code>: <Type text="Promise" />
74-
- Deletes the alarm if one exists. Does not cancel the alarm handler if it is currently executing.
75-
76-
#### Supported options
77-
78-
- `setAlarm()` and `deleteAlarm()` support the same options as [`put()`](/durable-objects/api/storage-api/#put), but without `noCache`.
55+
<Render file="api-storage-alarms" product="durable-objects" />
7956

8057
## Other
8158

src/content/docs/durable-objects/api/sqlite-backed-storage.mdx renamed to src/content/docs/durable-objects/api/sqlite-storage-api.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ JavaScript is a single-threaded and event-driven programming language. This mean
4848

4949
## SQL API
5050

51-
The `SqlStorage` interface encapsulates methods that modify the SQLite database embedded within a Durable Object. The `SqlStorage` interface is accessible via the [`sql` property](/durable-objects/api/storage-api/#sql) of `DurableObjectStorage` class.
51+
The `SqlStorage` interface encapsulates methods that modify the SQLite database embedded within a Durable Object. The `SqlStorage` interface is accessible via the [`sql` property](/durable-objects/api/sqlite-storage-api/#sql) of `DurableObjectStorage` class.
5252

5353
For example, using `sql.exec()`, a user can create a table, then insert rows into the table.
5454

@@ -133,7 +133,7 @@ console.log(cursor.toArray()); // prints [{ artistid: 456, artistname: 'Bob' },{
133133
- Any numeric value in a column is affected by JavaScript's 52-bit precision for numbers. If you store a very large number (in `int64`), then retrieve the same value, the returned value may be less precise than your original number.
134134

135135
:::note[SQL transactions]
136-
Note that `sql.exec()` cannot execute transaction-related statements like `BEGIN TRANSACTION` or `SAVEPOINT`. Instead, use the [`ctx.storage.transaction()`](/durable-objects/api/storage-api/#transaction) or [`ctx.storage.transactionSync()`](/durable-objects/api/storage-api/#transactionsync) APIs to start a transaction, and then execute SQL queries in your callback.
136+
Note that `sql.exec()` cannot execute transaction-related statements like `BEGIN TRANSACTION` or `SAVEPOINT`. Instead, use the [`ctx.storage.transaction()`](/durable-objects/api/sqlite-storage-api/#transaction) or [`ctx.storage.transactionSync()`](/durable-objects/api/sqlite-storage-api/#transactionsync) APIs to start a transaction, and then execute SQL queries in your callback.
137137
:::
138138

139139
#### Examples

src/content/docs/durable-objects/best-practices/access-durable-objects-storage.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A Durable Object's [in-memory state](/durable-objects/reference/in-memory-state/
2222

2323
<Render file="do-sqlite-storage-no-bill-note" product="durable-objects" />
2424

25-
[Storage API methods](/durable-objects/api/storage-api/#methods) are available on `ctx.storage` parameter passed to the Durable Object constructor. Storage API has several methods, including SQL, point-in-time recovery (PITR), key-value (KV), and alarm APIs.
25+
[Storage API methods](/durable-objects/api/sqlite-storage-api/) are available on `ctx.storage` parameter passed to the Durable Object constructor. Storage API has several methods, including SQL, point-in-time recovery (PITR), key-value (KV), and alarm APIs.
2626

2727
Only Durable Object classes with a SQLite storage backend can access SQL API.
2828

@@ -40,13 +40,13 @@ new_sqlite_classes = ["MyDurableObject"] # Array of new classes
4040

4141
</WranglerConfig>
4242

43-
[SQL API](/durable-objects/api/storage-api/#exec) is available on `ctx.storage.sql` parameter passed to the Durable Object constructor.
43+
[SQL API](/durable-objects/api/sqlite-storage-api/#exec) is available on `ctx.storage.sql` parameter passed to the Durable Object constructor.
4444

45-
SQLite-backed Durable Objects also offer [point-in-time recovery API](/durable-objects/api/storage-api/#pitr-point-in-time-recovery-api), which uses <GlossaryTooltip term="bookmark">bookmarks</GlossaryTooltip> to allow you to restore a Durable Object's embedded SQLite database to any point in time in the past 30 days.
45+
SQLite-backed Durable Objects also offer [point-in-time recovery API](/durable-objects/api/sqlite-storage-api/#pitr-point-in-time-recovery-api), which uses <GlossaryTooltip term="bookmark">bookmarks</GlossaryTooltip> to allow you to restore a Durable Object's embedded SQLite database to any point in time in the past 30 days.
4646

4747
### Initialize instance variables from storage
4848

49-
A common pattern is to initialize a Durable Object from [persistent storage](/durable-objects/api/storage-api/) and set instance variables the first time it is accessed. Since future accesses are routed to the same Durable Object, it is then possible to return any initialized values without making further calls to persistent storage.
49+
A common pattern is to initialize a Durable Object from [persistent storage](/durable-objects/api/sqlite-storage-api/) and set instance variables the first time it is accessed. Since future accesses are routed to the same Durable Object, it is then possible to return any initialized values without making further calls to persistent storage.
5050

5151
```ts
5252
import { DurableObject } from "cloudflare:workers";
@@ -75,7 +75,7 @@ export class Counter extends DurableObject {
7575

7676
A Durable Object fully ceases to exist if, when it shuts down, its storage is empty. If you never write to a Durable Object's storage at all (including setting <GlossaryTooltip term="alarm">alarms</GlossaryTooltip>), then storage remains empty, and so the Durable Object will no longer exist once it shuts down.
7777

78-
However if you ever write using [Storage API](/durable-objects/api/storage-api/), including setting alarms, then you must explicitly call [`storage.deleteAll()`](/durable-objects/api/storage-api/#deleteall) to empty storage and [`storage.deleteAlarm()`](/durable-objects/api/storage-api/#deletealarm) if you've configured an alarm. It is not sufficient to simply delete the specific data that you wrote, such as deleting a key or dropping a table, as some metadata may remain. The only way to remove all storage is to call `deleteAll()`. Calling `deleteAll()` ensures that a Durable Object will not be billed for storage.
78+
However if you ever write using [Storage API](/durable-objects/api/sqlite-storage-api/), including setting alarms, then you must explicitly call [`storage.deleteAll()`](/durable-objects/api/sqlite-storage-api/#deleteall) to empty storage and [`storage.deleteAlarm()`](/durable-objects/api/sqlite-storage-api/#deletealarm) if you've configured an alarm. It is not sufficient to simply delete the specific data that you wrote, such as deleting a key or dropping a table, as some metadata may remain. The only way to remove all storage is to call `deleteAll()`. Calling `deleteAll()` ensures that a Durable Object will not be billed for storage.
7979

8080
```ts
8181
export class MyDurableObject extends DurableObject<Env> {

src/content/docs/durable-objects/best-practices/websockets.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ The following are methods available on the **Native Durable Object WebSocket API
174174
</code>
175175
: <Type text="void" />
176176

177-
- Keeps a copy of `value` associated with the WebSocket to survive hibernation. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types. If the value needs to be durable please use [Durable Object Storage](/durable-objects/api/storage-api/).
177+
- Keeps a copy of `value` associated with the WebSocket to survive hibernation. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types. If the value needs to be durable please use [Durable Object Storage](/durable-objects/api/sqlite-storage-api/).
178178

179-
- If you modify `value` after calling this method, those changes will not be retained unless you call this method again. The serialized size of `value` is limited to 2,048 bytes, otherwise this method will throw an error. If you need larger values to survive hibernation, use the [Storage API](/durable-objects/api/storage-api/) and pass the corresponding key to this method so it can be retrieved later.
179+
- If you modify `value` after calling this method, those changes will not be retained unless you call this method again. The serialized size of `value` is limited to 2,048 bytes, otherwise this method will throw an error. If you need larger values to survive hibernation, use the [Storage API](/durable-objects/api/sqlite-storage-api/) and pass the corresponding key to this method so it can be retrieved later.
180180

181181
#### `WebSocket.deserializeAttachment()`
182182

src/content/docs/durable-objects/concepts/what-are-durable-objects.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Durable Objects have properties that make them a great fit for distributed state
2121

2222
**Storage colocated with compute**
2323

24-
- Each Durable Object has its own [durable, transactional, and strongly consistent storage](/durable-objects/api/storage-api/) (up to 10 GB[^1]), persisted across requests, and accessible only within that object.
24+
- Each Durable Object has its own [durable, transactional, and strongly consistent storage](/durable-objects/api/sqlite-storage-api/) (up to 10 GB[^1]), persisted across requests, and accessible only within that object.
2525

2626
**Single-threaded concurrency**
2727

@@ -46,9 +46,9 @@ In-memory state is reset when the Durable Object hibernates after being idle for
4646

4747
### Storage API
4848

49-
The [Durable Object Storage API](/durable-objects/api/storage-api/) allows Durable Objects to access fast, transactional, and strongly consistent storage. A Durable Object's attached storage is private to its unique instance and cannot be accessed by other objects.
49+
The [Durable Object Storage API](/durable-objects/api/sqlite-storage-api/) allows Durable Objects to access fast, transactional, and strongly consistent storage. A Durable Object's attached storage is private to its unique instance and cannot be accessed by other objects.
5050

51-
There are two flavors of the storage API, a [key-value (KV) API](/durable-objects/api/storage-api/#kv-api) and an [SQL API](/durable-objects/api/storage-api/#sql-api).
51+
There are two flavors of the storage API, a [key-value (KV) API](/durable-objects/api/legacy-kv-storage-api/) and an [SQL API](/durable-objects/api/sqlite-storage-api/).
5252

5353
When using the [new SQLite in Durable Objects storage backend](/durable-objects/reference/durable-objects-migrations/#enable-sqlite-storage-backend-on-new-durable-object-class-migration), you have access to both the APIs. However, if you use the previous storage backend you only have access to the key-value API.
5454

0 commit comments

Comments
 (0)