You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/api/sql-storage.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ SQL API methods accessed with `ctx.storage.sql` are only allowed on [Durable Obj
38
38
:::
39
39
40
40
:::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).
42
42
43
43
Writing data to [SQLite virtual tables](https://www.sqlite.org/vtab.html) also counts towards rows written.
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/api/storage-api.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,15 +52,15 @@ export class Counter extends DurableObject {
52
52
## Methods
53
53
54
54
:::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).
56
56
57
57
Otherwise, a Durable Object class has a key-value storage backend.
58
58
:::
59
59
60
60
The Durable Object Storage API comes with several methods, including key-value (KV) API, SQL API, and point-in-time-recovery (PITR) API.
61
61
62
62
- 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.
64
64
65
65
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.
66
66
@@ -110,7 +110,7 @@ Each method is implicitly wrapped inside a transaction, such that its results ar
- 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.
114
114
- 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).
115
115
-`deleteAll()` does not proactively delete [Alarms](/durable-objects/api/alarms/). Use [`deleteAlarm()`](/durable-objects/api/alarms/#deletealarm) to delete an alarm.
116
116
@@ -203,13 +203,13 @@ The `put()` method returns a `Promise`, but most applications can discard this p
203
203
204
204
- 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.
205
205
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.
207
207
208
208
### `transactionSync`
209
209
210
210
-`transactionSync(callback)`: <Typetext='any' />
211
211
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).
213
213
214
214
- Invokes `callback()` wrapped in a transaction, and returns its result.
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/platform/limits.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Durable Objects have limits.
46
46
47
47
## SQLite Durable Object SQL limits
48
48
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:
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.
16
16
17
17
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).
18
18
19
19
:::note[SQLite in Durable Objects]
20
20
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).
Copy file name to clipboardExpand all lines: src/content/glossary/durable-objects.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ entries:
27
27
28
28
- term: "Storage Backend"
29
29
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).
Copy file name to clipboardExpand all lines: src/content/partials/durable-objects/durable-objects-vs-d1.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
## SQL in Durable Objects vs D1
6
6
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?
Copy file name to clipboardExpand all lines: src/content/release-notes/durable-objects.yaml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,17 +16,17 @@ entries:
16
16
- publish_date: "2024-10-07"
17
17
title: Alarms re-enabled in (beta) SQLite-backed Durable Object classes
18
18
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.
20
20
21
21
- publish_date: "2024-09-27"
22
22
title: Alarms disabled in (beta) SQLite-backed Durable Object classes
23
23
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.
25
25
26
26
- publish_date: "2024-09-26"
27
27
title: (Beta) SQLite storage backend & SQL API available on new Durable Object classes
28
28
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.
30
30
31
31
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.
0 commit comments