Skip to content

feat(miniflare): Add implementation for local explorer D1 API#12267

Merged
NuroDev merged 57 commits intomainfrom
NuroDev/local-explorer-d1-api
Feb 3, 2026
Merged

feat(miniflare): Add implementation for local explorer D1 API#12267
NuroDev merged 57 commits intomainfrom
NuroDev/local-explorer-d1-api

Conversation

@NuroDev
Copy link
Copy Markdown
Member

@NuroDev NuroDev commented Jan 29, 2026

This PR follows on from #12152 and adds a D1 compatible API to the local explorer API worker. That includes adding the following endpoints with their respective handling logic:

  • GET /d1/database - Returns a list of D1 databases.
  • POST /d1/database/{database_id}/raw - Returns the query result rows as arrays rather than objects.

  • 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: Experimental WIP project

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


Open with Devin

@NuroDev NuroDev self-assigned this Jan 29, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: 94888cc

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 Jan 29, 2026

Claude finished @NuroDev's task —— View job


Changeset Review

  • Read changeset guidelines
  • Review changeset file
  • Check for cute animals
  • Post review results

⚠️ Issues found

Issue: Missing experimental feature opt-in note

According to the changeset guidelines (line 23 of .changeset/README.md):

When adding or changing experimental features, call this out explicitly in the changeset description.

The changeset correctly identifies this as work on an "experimental/WIP local resource explorer" in the title, but should include information about how users can opt in to or use this experimental feature.

Recommendation

Add a note explaining how users can access or enable this experimental feature. For example:

---
"miniflare": minor
---

Implement local D1 API for experimental/WIP local resource explorer

The following APIs have been (mostly) implemented:

- `GET /d1/database` - Returns a list of D1 databases.
- `POST /d1/database/{database_id}/raw` - Returns the query result rows as arrays rather than objects.

**Note**: This is an experimental feature for the local resource explorer. [Add details about how to enable/use this feature]

Other validation results

Version Type: minor is correct for new features (adding new API endpoints)
Changelog Quality: Description is clear and specific about what was added
Markdown Headers: No h1/h2/h3 headers used
Analytics: No analytics changes
Not a Dependabot PR: Regular feature PR


@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jan 29, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 94888cc

@NuroDev NuroDev marked this pull request as ready for review January 29, 2026 15:34
@NuroDev NuroDev requested a review from a team as a code owner January 29, 2026 15:34
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View issue and 4 additional flags in Devin Review.

Open in Devin Review

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Feb 3, 2026
@NuroDev NuroDev merged commit 83adb2c into main Feb 3, 2026
42 of 43 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Feb 3, 2026
@NuroDev NuroDev deleted the NuroDev/local-explorer-d1-api branch February 3, 2026 17:44
@NuroDev NuroDev mentioned this pull request Feb 5, 2026
5 tasks
Comment on lines +11 to +16
// The base API response schemas define `result` as a generic object,
// but child schemas override it with specific types (e.g., arrays).
// OpenAPI's `allOf` is meant to merge schemas, but @hey-api/openapi-ts
// generates Zod's `.and()` (intersection), which doesn't allow property
// overrides. Removing `result` from base schemas allows child schemas
// to define their own `result` type without conflicts.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@NuroDev @emily-shen is this something that should be improved or fixed in @hey-api? I'm not clear whether this is a Zod limitation or an issue with the library

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