Skip to content

Wrangler commands

Last updated View as MarkdownAgent setup

r2 sql query

Execute SQL query against R2 Data Catalog

npx wrangler r2 sql query [WAREHOUSE] [QUERY]
  • [WAREHOUSE]string required

    R2 Data Catalog warehouse name

  • [QUERY]string required

    The SQL query to execute

Global flags

  • --vboolean alias: --version

    Show version number

  • --cwdstring

    Run as if Wrangler was started in the specified directory instead of the current working directory

  • --configstring alias: --c

    Path to Wrangler configuration file

  • --envstring alias: --e

    Environment to use for operations, and for selecting .env and .dev.vars files

  • --env-filestring

    Path 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-provisiondefault: true

    Experimental: Enable automatic resource provisioning

  • --experimental-auto-createboolean alias: --x-auto-createdefault: true

    Automatically provision draft bindings with new resources

  • --install-skillsboolean default: false

    Install Cloudflare skills for detected AI coding agents before running the command

  • --profilestring

    Use a specific auth profile

Was this helpful?