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
The `DurableObjectId` interface refers to a new or existing Durable Object instance. This interface is most frequently used to by [`DurableObjectNamespace::get`](./namespace.mdx) to obtain a stub for submitting requests to the Durable Object class.
12
+
The `DurableObjectId` interface refers to a new or existing Durable Object instance. This interface is most frequently used by [`DurableObjectNamespace::get`](./namespace.mdx) to obtain a stub for submitting requests to the Durable Object class.
13
13
14
14
Note that creating an ID for a Durable Object instance does not invoke the constructor of the Durable Object. This is done lazily when calling [`DurableObjectNamespace::get`](../namespace/#get) to create a [`DurableObjectStub`](../stub) from a `DurableObjectId`. This ensures that objects are not constructed unless their methods can be directly invoked.
15
15
16
16
:::note[`DurableObjectId`]
17
17
18
-
If you are experiencing an issue with a particular Durable Object instance the `DurableObjectId` corresponding to this particular instance is very helpful for obtaining a resolution through Cloudflare support. It is advisable to log a`DurableObjectId` from a Worker and include it in support requests where applicable.
18
+
If you are experiencing an issue with a particular Durable Object instance, you may wish to log the`DurableObjectId` from your Worker and include it in your Cloudflare support request.
The `DurableObjectNamespace` interface is used to obtain a reference to a new or existing Durable Object instance. The interface is accessible from the fetch handler on a Cloudflare Worker via the `env` parameter, which is the standard interface for reference bindings declared in `wrangler.toml`.
12
+
The `DurableObjectNamespace` interface is used to obtain a reference to a new or existing Durable Object instance. The interface is accessible from the fetch handler on a Cloudflare Worker via the `env` parameter, which is the standard interface when referencing bindings declared in `wrangler.toml`.
13
13
14
-
There are several functions of this interface that can be used to create an ID for a Durable Object instance. Note that creating an ID for a Durable Object instance does not invoke the constructor of the Durable Object. This is done lazily when calling [`DurableObjectNamespace::get`](../namespace/#get) to create a [`DurableObjectStub`](../stub) from a `DurableObjectId`. This ensures that objects are not constructed unless their methods can be directly invoked.
14
+
This interface defines several [methods](../namespace/#methods) that can be used to create an ID for a Durable Object instance. Note that creating an ID for a Durable Object instance does not invoke the constructor of the Durable Object. This is done lazily when calling [`DurableObjectNamespace::get`](../namespace/#get) to create a [`DurableObjectStub`](../stub) from a `DurableObjectId`. This ensures that objects are not constructed unless their methods can be directly invoked.
* 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/best-practices/access-durable-objects-storage/#sqlite-storage-backend), `deleteAll()` removes the entire contents of a Durable Object's private SQLite database.
103
+
* 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/best-practices/access-durable-objects-storage/#sqlite-storage-backend), `deleteAll()` removes the entire contents of a Durable Object's private SQLite database.
104
104
* 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).
105
105
*`deleteAll()` does not proactively delete [Alarms](/durable-objects/api/alarms/). Use [`deleteAlarm()`](/durable-objects/api/alarms/#deletealarm) to delete an alarm.
Copy file name to clipboardExpand all lines: src/content/docs/durable-objects/reference/data-location.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@ Jurisdictions are used to create Durable Object instances that only run and stor
11
11
12
12
Workers may still access Durable Objects constrained to a jurisdiction from anywhere in the world. The jurisdiction constraint only controls where the Durable Object itself runs and persists data. Consider using [Regional Services](/data-localization/regional-services/) to control the regions from which Cloudflare responds to requests.
13
13
14
-
:::note[logging]
14
+
:::note[Logging]
15
15
16
16
A [`DurableObjectId`](../../api/id) will be logged outside of the specified jurisdiction for billing and debugging purposes.
17
17
18
18
:::
19
19
20
-
Durable Object instances can be restricted to a specific jurisdiction either by creating a [`DurableObjectNamespace`](../../api/namespace/) restricted to a jurisdiction or by creating an individual [`DurableObjectId`](../../api/id) restricted to a jurisdiction:
20
+
Durable Object instances can be restricted to a specific jurisdiction either by creating a [`DurableObjectNamespace`](../../api/namespace/) restricted to a jurisdiction, or by creating an individual [`DurableObjectId`](../../api/id) restricted to a jurisdiction:
console.assert(!euId1.equal(euId2), "This should always be true");
35
35
```
36
36
37
-
While methods on a [`DurableObjectNamespace`](../../api/namespace/) that take a [`DurableObjectId`](../../api/id) as a parameter will throw an exception if the parameter is associated with a different jurisdiction, these methods will not throw an exception if the [`DurableObjectNamespace`](../../api/namespace/) is not associated with a jurisdiction. The common case is that any valid [`DurableObjectId`](../../api/id) can be used in the top-level namespace's methods.
37
+
Methods on a [`DurableObjectNamespace`](../../api/namespace/) that take a [`DurableObjectId`](../../api/id) as a parameter will throw an exception if the parameter is associated with a different jurisdiction. However, these methods will not throw an exception if the [`DurableObjectNamespace`](../../api/namespace/) is not associated with a jurisdiction. The common case is that any valid [`DurableObjectId`](../../api/id) can be used in the top-level namespace's methods.
0 commit comments