Wrangler commands
Execute SQL query against R2 Data Catalog
npx wrangler r2 sql query [WAREHOUSE] [QUERY]pnpm wrangler r2 sql query [WAREHOUSE] [QUERY]yarn wrangler r2 sql query [WAREHOUSE] [QUERY]-
[WAREHOUSE]string requiredR2 Data Catalog warehouse name
-
[QUERY]string requiredThe SQL query to execute
Global flags
-
--vboolean alias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstring alias: --cPath to Wrangler configuration file
-
--envstring alias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionboolean aliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createboolean alias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-