Cloudflare 中文文档
D1
编辑这个页面
跳转官方原文档
Set theme to dark (⇧+D)

Environments

Environments are different contexts that your code runs in. Cloudflare Developer Platform allows you to create and manage different environments. Through environments, you can deploy the same project to multiple places under multiple names.

To specify different D1 databases for different environments, use the following syntax in your wrangler.toml file:

In the code above, the staging environment is using a different database (DATABASE_NAME_1) than the production environment (DATABASE_NAME_2).