Yeah, for now it has to be declared separately
Yeah, for now it has to be declared separately
deleteAll
deleteAll(options Object optional): Promise
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, deleteAll() removes the entire contents of a Durable Object's private SQLite database, including both SQL data and key-value data.

https://cloudflare.com/cdn-cgi/trace from the DO to work out where it is and return early if in HKGwrangler dev --remote, to connect with KVsayHello RCP or the alarm API could be called from a WFP user script?await this.ctx.storage.setAlarm(Date.now()); ) could I run into any issues? Are there any gotchas here? I have been using this and it works, however, I have encountered (what seems to be) race conditions with this async work so I wonder if that immediate alarm has anything to do with this.this.state.acceptWebSocket(socket, topic), then to find connections by topic you would do this.state.getWebSockets(topic)this.storage.transactionSync(() => {...}) directly. In the callback, you can do a query, process it with code, do another query, etc. Then, every storage operation in that callback will either all-succeed or all-fail.[[durable_objects.bindings]]
name = "MY_DURABLE1"
class_name = "DO1"
[[durable_objects.bindings]]
name = "MY_DURABLE2"
class_name = "DO2"
[[migrations]]
tag = "v2"
new_sqlite_classes = ["DO1", "DO2"]✘ [ERROR] Uncaught (in promise) Error: Error: This Durable Object is not backed by SQLite storage, so the SQL API is not available. SQL can be enabled on a new Durable Object class by using the `new_sqlite_classes` instead of `new_classes` under `[[migrations]]` in your wrangler.toml, but an already-deployed class cannot be converted to SQLite (except by deleting the existing data).public executeTransaction(
queries: { sql: string; params?: unknown[] }[]
): unknown[] {
return this.storage.transactionSync(() => {
const results = []
try {
for (const queryObj of queries) {
const { sql, params } = queryObj
const result = this.executeQuery({ sql, params })
results.push(result)
}
return results
} catch (error) {
console.error('Transaction Execution Error:', error)
throw error
}
})
}