Harold Anderson
CDCloudflare Developers
•Created by Harold Anderson on 10/14/2024 in #pages-help
Where to put database_id for a D1 database?
Thank you for clearing this up.
15 replies
CDCloudflare Developers
•Created by Harold Anderson on 10/14/2024 in #pages-help
Where to put database_id for a D1 database?
Would it be possible/desirable/best practice to put d1_database in .dev.vars and reference it in wrangler.toml?
15 replies
CDCloudflare Developers
•Created by Harold Anderson on 10/14/2024 in #pages-help
Where to put database_id for a D1 database?
It seems to be saying not to use wrangler.toml, but to use .dev.vars instead.
15 replies
CDCloudflare Developers
•Created by Harold Anderson on 10/14/2024 in #pages-help
Where to put database_id for a D1 database?
I'm not really sure what that means.
15 replies
CDCloudflare Developers
•Created by Harold Anderson on 10/14/2024 in #pages-help
Where to put database_id for a D1 database?
So you can't refer to environment variables in a wrangler.toml file? Or does wrangler somehow read the environment variables instead of wrangler.toml?
When developing your Worker or Pages Function, create a .dev.vars file in the root of your project to define secrets that will be used when running wrangler dev or wrangler pages dev, as opposed to using environment variables in wrangler.toml. This works both in local and remote development modes.
The .dev.vars file should be formatted like a dotenv file, such as KEY="VALUE":
15 replies
CDCloudflare Developers
•Created by Harold Anderson on 10/14/2024 in #pages-help
Where to put database_id for a D1 database?
OK, well that makes things easier. I was going to check it into Github so other people can see what I've done, and I thought having my actual database_id wouldn't be very elegant.
15 replies
CDCloudflare Developers
•Created by Harold Anderson on 10/14/2024 in #pages-help
Where to put database_id for a D1 database?
Really?
binding = "DB"
database_name = "my_sveltekit_db"
database_id = "342dcda3-70fa-4a97-b3be-6f3c37b5cad8"
15 replies