Skip to content

Cloudflare

To set up Cloudflare with DBCode, you will need to use an API token.

You can obtain your API key by following the instructions provided on the Create Token page.

The API Token should have the following permissions:

  • Account - Account Settings - Read
  • Account - D1 - Edit
  • Account - Workers R2 Storage - Read
  • Account - Workers R2 Data Catalog - Read
  • Account - Workers R2 SQL - Read

Expanding an account shows a D1 connection and an R2 SQL connection; open either to see its databases or catalog-enabled buckets. Permission problems with a product’s token surface when you connect, not while browsing.

R2 SQL needs all three R2 permissions. R2 SQL queries the underlying Iceberg data files using credentials that inherit your token’s R2 storage permission, so a token with only R2 Data Catalog and R2 SQL read can list your catalog-enabled buckets in the tree but returns a Corrupted Catalog error when you run a query. Add Workers R2 Storage - Read to fix it.

Once you have your API token, follow the steps in the connect a cloud provider article.

For more information about Cloudflare, check out their website.