Hello Can anyone guide me on how to connect workers with Cloudflare d1 and different environments Th
Hello
Can anyone guide me on how to connect workers with Cloudflare d1 and different environments
The connection is fine if i go with the default wrangler.toml configuration but the moment i go with this approach (Check code below) the db connection never happens at all
Approach i am trying to use
d1_databases = [
{ binding = "DB", database_name = "<DATABASE_NAME_1>", database_id = "<UUID1>" },
]
d1_databases = [
{ binding = "DB", database_name = "<DATABASE_NAME_2>", database_id = "<UUID2>" },
]
MY BINDING
my endpoint (Using hono js)
Can anyone guide me on how to connect workers with Cloudflare d1 and different environments
The connection is fine if i go with the default wrangler.toml configuration but the moment i go with this approach (Check code below) the db connection never happens at all
Approach i am trying to use
This is a staging environment
[env.staging]d1_databases = [
{ binding = "DB", database_name = "<DATABASE_NAME_1>", database_id = "<UUID1>" },
]
This is a production environment
[env.production]d1_databases = [
{ binding = "DB", database_name = "<DATABASE_NAME_2>", database_id = "<UUID2>" },
]
MY BINDING
my endpoint (Using hono js)







