What do you mean "close" the transaction? The transaction is a callback that you pass to the `transa
What do you mean "close" the transaction? The transaction is a callback that you pass to the
transaction() method.transaction()Error: Durable Object test helpers can only be used with stubs pointing to objects defined within the same worker.
state.storage.deleteAll() to remove an old instance. An old instance will not incur any request or duration charges if they aren't being accessed, but their used storage will be charged until deletedHibernation is only supported when a Durable Object acts as a WebSocket server. Currently, outgoing WebSockets cannot hibernate. on this page here: https://developers.cloudflare.com/durable-objects/best-practices/websockets/#websocket-hibernation-apistorage.get() and provide multiple keys, does each key count as a read unit, or do we count units per 4KB for all keys combined? Trying to minimise storage usage without moving to SQL backendfunction doX() {
this.promiseTxn = this.storage.transaction(async (txn) => {
const a = txn.get("keyA");
const nextRequestValue = await this.waitForAValueSetByAFutureRequest();
txn.put("keyB", a + nextRequestValue);
});
}state.storage.deleteAll()Hibernation is only supported when a Durable Object acts as a WebSocket server. Currently, outgoing WebSockets cannot hibernate.storage.get()// Using KV for simplicity
const a = txn.get("foo")txn.put("bar", a + "yo");miniflare: {
workers: [
{
name: "dummy-do",
modules: true,
scriptPath: "./test/database/mo.ts"
}
],
durableObjects: {
"MockSqlBackupDO": { className: "DummyDO", scriptName: "dummy-do", useSQLite: true }
}
}