Skip to content

Conversation

@dschewchenko
Copy link
Contributor

Summary

There is no mention that if you have multiple environments and separate db names for each in wrangler.toml, to use proper binding you must set --env parameter. It's supported, but not documented.

Without this parameter there will be error:

Couldn't find a D1 DB with the name or binding 'some-db-production' in wrangler.toml.

Where 'some-db-production' is in:
[env.production]
[[env.production.d1_databases]]
binding = "DB"
database_name = "some-db-production"
database_id = "00000000-0000-0000-0000-000000000000"

Documentation checklist

  • The documentation style guide has been adhered to.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

There is no mention that if you have multiple environments in wrangler.toml, to use proper binding you must set --env parametr
@ToriLindsay ToriLindsay merged commit 09c8ea5 into cloudflare:production Oct 31, 2024
7 checks passed
@workers-devprod workers-devprod added the contribution [Holopin] Recognizes a docs contribution, big or small label Oct 31, 2024
@holopin-bot
Copy link

holopin-bot bot commented Oct 31, 2024

Congratulations @dschewchenko, the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cm2xa108a107650clcak2qg48v

This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

elithrar pushed a commit that referenced this pull request Nov 6, 2024
* Update commands.mdx

There is no mention that if you have multiple environments in wrangler.toml, to use proper binding you must set --env parametr

* Update src/content/docs/workers/wrangler/commands.mdx

---------

Co-authored-by: ToriLindsay <[email protected]>
harshil1712 pushed a commit that referenced this pull request Dec 3, 2024
* Update commands.mdx

There is no mention that if you have multiple environments in wrangler.toml, to use proper binding you must set --env parametr

* Update src/content/docs/workers/wrangler/commands.mdx

---------

Co-authored-by: ToriLindsay <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution [Holopin] Recognizes a docs contribution, big or small product:workers Related to Workers product size/xs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants