Skip to content

[wrangler] Data platform CLI improvements#14267

Draft
Marcinthecloud wants to merge 5 commits into
cloudflare:mainfrom
Marcinthecloud:dataplatform-improvements
Draft

[wrangler] Data platform CLI improvements#14267
Marcinthecloud wants to merge 5 commits into
cloudflare:mainfrom
Marcinthecloud:dataplatform-improvements

Conversation

@Marcinthecloud

@Marcinthecloud Marcinthecloud commented Jun 11, 2026

Copy link
Copy Markdown

Changes

R2 SQL (wrangler r2 sql query)

  • New: --json flag — output results as a JSON array for scripting/piping to jq
  • New: --csv flag — output results as RFC 4180-compliant CSV
  • New: --sql-file flag — read query from a .sql file (matches pipelines create --sql-file)
  • New: EXPLAIN FORMAT JSON queries are automatically pretty-printed
  • Improved: Metrics line now shows R2 request count: Read 1.05 MB across 2 files (5 R2 requests)
# JSON output
wrangler r2 sql query "$WAREHOUSE" "SELECT * FROM ns.table LIMIT 5" --json | jq .

# CSV export
wrangler r2 sql query "$WAREHOUSE" "SELECT * FROM ns.table" --csv > data.csv

# Query from file
wrangler r2 sql query "$WAREHOUSE" --sql-file query.sql

Pipelines

  • Fixed: pipelines sinks list --json now outputs valid JSON (was outputting Node.js util.inspect format with unquoted keys and [Object] placeholders)
  • New: pipelines streams create now shows the binding snippet and prompts to auto-add it to wrangler.json — matching kv namespace create, d1 create, etc. Supports --binding, --update-config, and --use-remote flags.
  • New: pipelines setup now prompts to auto-add the binding to config at the end of the wizard
  • Fixed: Binding snippet now uses "stream" field instead of the deprecated "pipeline" field
  • Removed: pipelines create no longer shows binding/usage examples (the pipeline itself has no binding — only the stream does)

Config normalization

  • The deprecated "pipeline" field in wrangler.json pipeline bindings is now normalized to "stream" during config validation, with the old field removed. Downstream consumers no longer need fallback logic.

  • 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: CLI help text and --help output updated inline; no new concepts requiring docs changes

Open in Devin Review

@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 31265b8

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

This PR includes changesets to release 7 packages
Name Type
wrangler Minor
@cloudflare/workers-utils Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
@cloudflare/cli-shared-helpers Patch
@cloudflare/deploy-helpers Patch
@cloudflare/workers-auth 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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Jun 11, 2026
@workers-devprod workers-devprod requested review from a team and james-elicx and removed request for a team June 11, 2026 18:08
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/data-platform-pipeline-stream-normalization.md: [@cloudflare/wrangler]
  • .changeset/data-platform-pipelines-fixes.md: [@cloudflare/wrangler]
  • .changeset/data-platform-pipelines-streams-binding.md: [@cloudflare/wrangler]
  • .changeset/data-platform-r2-sql-improvements.md: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/helpers/create-worker-upload-form.ts: [@cloudflare/wrangler]
  • packages/deploy-helpers/src/deploy/helpers/print-bindings.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/plugins/pipelines/index.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/config/validation.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/pipelines-setup.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/pipelines.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/r2/sql.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/dev/miniflare/index.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/pipelines/cli/create.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/pipelines/cli/sinks/list.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/pipelines/cli/streams/create.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/pipelines/cli/streams/utils.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/preview/shared.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/r2/sql.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/type-generation/index.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/type-generation/pipeline-schema.ts: [@cloudflare/wrangler]

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread packages/miniflare/src/plugins/pipelines/index.ts Outdated
Comment thread packages/wrangler/src/type-generation/index.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown
create-cloudflare

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

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14267

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14267

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

commit: 31265b8

@james-elicx james-elicx marked this pull request as draft June 11, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants