Research on local resource inspection
π Hey folks, we're doing a little discovery on local debugging with local resources/bindings when building with wrangler, and looking for some feedback. If you've previously posted feedback on this kind of idea please link it to me in the thread I am sorry I haven't been here that long!
Do you ever have challenges with this? What do you typically do to check the state of your locally emulated CF resources when developing/seeding/resetting around stateful stuff. This would be using tools like D1, R2, DOs or KV, and having a local version of your application without using
remote: true.
Recently we came across this VS Code extension that allows you to view KV data locally. Has anyone tried this or tools that do similar jobs for D1 or other resources, I can think of a couple! (Here's the extension https://marketplace.windsurf.com/vscode/item?itemName=swalkerdev.cloudflare-kv-explorer)
I'd love to hear what's working, what's not working, what tools you've tried, and especially any specific challenges you have had in this space. Starting a thread π§΅ .6 Replies
I am using WebStorm and its database intergation to browse the sqlite file of D1 instead of command line.
ooh interesting! I haven't used webstorm for a long time. Is this a common thing for you to do when in local dev?
Its convenient. Its easier to click buttons than to write sql query all the time π Also with terminal you have only one line, with IDE you can have multiple queries in one editor try stuff.
I usually spin up Wrangler with local bindings for KV and test writes/reads there, but debugging state gets messy fast once thereβs webhook or auth logic in play.
Right now I just dump JSON snapshots of KV to a local file when seeding/resetting β nothing fancy, but it helps when checking state transitions or verifying cache layers.
Would love a unified viewer for Workers bindings though β something that can inspect KV, DOs, and D1 without jumping between CLI and remote logs. That VS Code extension looks promising; Iβll check it out.
I also open the .wrangler/state files for my durable objects in a database editor (TablePlus)..
As someone who works with Workers a lot, there's a definite need to debug my local resources.
On my most recent project, I have had to use
sqlite3 many times to inspect my Durable Object SQLite data. If we can have some UI which would allow us to dig into what resources exist, that would be :chefskiss:
sqlite3 is fine but it requires knowledge that you can even do this and also understanding what files things are even written to. c7748111df1534600070b7b1f4cbc3239477a7a3a41f0054f6097552ce0ba480.sqlite is not a very useful name for me to go on :p
My wishlist:
* Be able to see what instances exist (e.g. What DOs exist - along with their names not just these random IDs, What Workflows exist, etc.)
* Be able to drill into the storage - I need to be able to dig into what is being set in my SQLite DB for DOs for example
* Be able to set the storage - If there's a bug or I just need to force some state, allow me to do that