Skip to content

Conversation

@laplab
Copy link
Contributor

@laplab laplab commented Sep 5, 2025

Fixes https://jira.cfdata.org/browse/KRB-49.

This change adds one command: wrangler r2 sql query - send an SQL query targeting an R2 Data Catalog.

This command relies on CLOUDFLARE_API_TOKEN env variable to provide an API token. For now, a separate token with specific permissions is required to connect to the R2 SQL service.


@changeset-bot
Copy link

changeset-bot bot commented Sep 5, 2025

🦋 Changeset detected

Latest commit: b368fe6

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

This PR includes changesets to release 3 packages
Name Type
wrangler Minor
@cloudflare/vite-plugin Major
@cloudflare/vitest-pool-workers Patch

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 5, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: b368fe6

@laplab laplab marked this pull request as ready for review September 8, 2025 10:57
@laplab laplab requested a review from a team as a code owner September 8, 2025 10:57
@laplab laplab force-pushed the nlapkov/sql-command branch from 5495b00 to ea5d367 Compare September 8, 2025 11:07
@laplab laplab added the skip-v3-pr Skip validation of presence of a v3 backport PR label Sep 8, 2025
@sejoker
Copy link

sejoker commented Sep 8, 2025

@laplab please update PR description with a brief intro about CLOUDFLARE_R2_SQL_TOKEN env variable.

@laplab laplab force-pushed the nlapkov/sql-command branch from fe48a3c to 67dc2fa Compare September 9, 2025 11:15
@laplab laplab force-pushed the nlapkov/sql-command branch from fa4bf40 to a9fec20 Compare September 10, 2025 09:47
@laplab laplab requested a review from penalosa September 10, 2025 11:45
@laplab laplab requested a review from penalosa September 10, 2025 14:17
@laplab laplab force-pushed the nlapkov/sql-command branch from 54b4f94 to b368fe6 Compare September 10, 2025 14:46
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Sep 11, 2025
@penalosa penalosa merged commit 30f558e into main Sep 11, 2025
36 of 38 checks passed
@penalosa penalosa deleted the nlapkov/sql-command branch September 11, 2025 10:50
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Sep 11, 2025
penalosa added a commit that referenced this pull request Sep 11, 2025
emily-shen pushed a commit that referenced this pull request Sep 12, 2025
* feat: r2 sql commands * fix: format results, fix bugs * fix: renames * fix: add tests * fix: use common framework for the token env variable * fix: add changeset * fix: snapshots * fix: formatting * fix: review * fix: replace UserError with APIError where appropriate * feat: add spinner while waiting for query result * fix: tests * fix: remove enable/disable commands * fix: update query url * fix: refactor Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com> * fix: docs link and refactor * fix: style * fix: tests * fix: lint --------- Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-v3-pr Skip validation of presence of a v3 backport PR

4 participants