problem with d1 locally

I am developing several workers that will use the same D1 but locally each one creates a different database instead of sharing the same one already created. I put the same database_id in both but it creates different dbs locally
No description
No description
2 Replies
lucasp
lucasp2mo ago
Is there any way to share the same database locally?
lucasp
lucasp2mo ago
Yes, I was reading about that but it doesn't say how to specify the local db in the other worker. https://developers.cloudflare.com/d1/build-with-d1/local-development/#persist-data i've added this in both projects but when i run migrations this run over .wrangler/state.../d1 .sqlite
js
"dev": "wrangler dev src/index.ts --persist-to ./home/lucas/Desktop/workers-test",
js
"dev": "wrangler dev src/index.ts --persist-to ./home/lucas/Desktop/workers-test",
Cloudflare Docs
Local development | Cloudflare D1 docs
D1 has fully-featured support for local development, running the same version of D1 as Cloudflare runs globally. Local development uses Wrangler, the command-line interface for Workers, to manage local development sessions and state.
Want results from more Discord servers?
Add your server