Confusing advice about secrets and Wrangler

From what I can tell, it does not make sense to put sensitive data in the TOML file because this would be committed.

CF acknowledges this by suggesting we use
.dev.vars
for local, and secrets for production.

However, when adding secrets (via the dashboard), CF then says it "recommend[s] updating your wrangler.toml file to keep your local development environment in sync."

So this advice seems to be contradictory.

A related issue is that, as far as I know, local DB connection strings for Hyperdrives must be specified in TOML, not
.dev.vars
(the latter didn't work for me). So this necessitates having two TOML files - one production, one local - the local one being denoted via the
--config
param, because putting the connection string in the main TOML would mean committing DB credentials.

Am I right in all the above, or can anyone clarify anything I'm missing?
Was this page helpful?