Skip to content
Cloudflare Docs

Wrangler commands

r2 sql query

Execute SQL query against R2 Data Catalog

Terminal window
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

  • --v boolean alias: --version

    Show version number

  • --cwd string

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

  • --config string alias: --c

    Path to Wrangler configuration file

  • --env string alias: --e

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

  • --env-file string

    Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files

  • --experimental-provision boolean aliases: --x-provision default: true

    Experimental: Enable automatic resource provisioning

  • --experimental-auto-create boolean alias: --x-auto-create default: true

    Automatically provision draft bindings with new resources