Skip to content

Is it possible to debug D1 databases and/or durable objects locally? #78

Discussion options

You must be logged in to vote

For durable objects:

In production (running on cloudflare via denoflare push) The doNamespace binding value looks like: my-do-namespace-name:MyDOClass

"bindings": {
    "backendNamespace": { "doNamespace": "backend-prod:BackendDO" },
}

For local serving, you can use a binding value of local:MyDOClass, which will instantiate your DO class locally and use an in-memory version for transactional storage (no persistence)

"bindings": {
    "backendNamespace": { "doNamespace": "local:BackendDO" },
}

or

you can add a few options to the local backend for persistent storage, storage=webstorage and name the local storage container container=my-container-name

"bindings": {
    "backendNamespace": { "…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by endereyewxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants