Skip to content

[explorer] Add DO /query endpoint that introspects DO sqlite#12574

Merged
emily-shen merged 6 commits intomainfrom
emily/do-sqlite-query-api
Feb 18, 2026
Merged

[explorer] Add DO /query endpoint that introspects DO sqlite#12574
emily-shen merged 6 commits intomainfrom
emily/do-sqlite-query-api

Conversation

@emily-shen
Copy link
Copy Markdown
Contributor

@emily-shen emily-shen commented Feb 16, 2026

This PR adds a query endpoint that runs queries against a DO instance's sqlite store.

This required:

  1. Adding a wrapper that extends user DO classes, and adds an __mf_introspectSqlite() method. This is necessary because ctx.storage.sql is not available on the stub, and only from inside the DO class. We apply this by re-exporting the user entry module.
  2. extensions field in openapi-filter-config.ts that specifies schemas to merge in. The query endpoint is not in the cloudflare public api schema. I've based the schema off what the dashboard uses though, so it should be totally compatible with the endpoint that the data studio in stratus uses.

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: wip experimental feature

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@emily-shen emily-shen requested a review from a team as a code owner February 16, 2026 16:57
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 248b977

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Feb 16, 2026

Claude finished @emily-shen's task —— View job


Changeset Review

Todo List:

  • Read changeset guidelines
  • Read and validate .changeset/ready-hotels-jump.md
  • Check for cute animal images

✅ All changesets look good

The changeset .changeset/ready-hotels-jump.md is well-formatted:

  • Version type: Minor is correct - this is a new feature for local explorer
  • Description quality: Clear explanation of what the feature does and the technical approach
  • Markdown headers: No h1/h2/h3 headers present
  • Experimental feature: Properly notes this is gated by X_LOCAL_EXPLORER env var and is experimental/WIP

The changeset appropriately explains that user DO classes are wrapped to add introspection capabilities, and mentions the env var users need to set to opt in.


Image Review: I checked the attached image but it appears to be just a small orange circle, not a cute animal. No cuteness report needed! 🔍

devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 16, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12574

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12574

miniflare

npm i https://pkg.pr.new/miniflare@12574

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12574

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12574

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12574

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12574

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12574

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12574

wrangler

npm i https://pkg.pr.new/wrangler@12574

commit: 248b977

@emily-shen emily-shen force-pushed the emily/do-sqlite-query-api branch 2 times, most recently from cdabe25 to 0b3711b Compare February 16, 2026 17:17
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a bunch of nits that you can do with as you please.
Well done getting this up and running.

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Feb 17, 2026
Copy link
Copy Markdown
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An overall comment is that I'd love for us to explore moving this to the runtime, and leveraging the existing work there.

Only blocker is removing the inline code string

@github-project-automation github-project-automation bot moved this from Approved to In Review in workers-sdk Feb 17, 2026
@emily-shen emily-shen force-pushed the emily/do-sqlite-query-api branch from 0b3711b to b88d69b Compare February 18, 2026 11:26
@emily-shen emily-shen force-pushed the emily/do-sqlite-query-api branch from b88d69b to e72318e Compare February 18, 2026 11:26
devin-ai-integration[bot]

This comment was marked as resolved.

@github-project-automation github-project-automation bot moved this from In Review to Approved in workers-sdk Feb 18, 2026
@emily-shen emily-shen merged commit 527e4f5 into main Feb 18, 2026
47 of 49 checks passed
@emily-shen emily-shen deleted the emily/do-sqlite-query-api branch February 18, 2026 14:33
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants