How to share state of D1 and other products locally (workers and pages project)) #16572
Labels
content:new
Request for new/missing content
documentation
Documentation edits
product:d1
D1: https://developers.cloudflare.com/d1/
product:workers
Related to Workers product
Proposed changes
https://developers.cloudflare.com/workers/wrangler/api/#parameters-1
https://developers.cloudflare.com/d1/build-with-d1/local-development/#persist-data
Subject Matter
How to share D1 and other projects locally between different projects
Content Location
I have a mono repo setup and I had spend a quite some time to figure out how to share cloudflare D1 between different projects locally. Cloudflare D1 states, are unique to each project locally. It would be good if there's specific documentation saying how to do that. For example if you want to link pages project and workers projects locally with one D1 you have to use get platform proxy function in pages and use its persist option with directory path and also do the same with workers but difference use the same directory with command option in Wrangler to persist. But how should one mange migrations now for common shared D1 locally
https://developers.cloudflare.com/d1/reference/migrations/#wrangler-customizations
Here it's mentioned that we can change the migration directory, but in this part
https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases, it's not mentioned only that there's option to rename the migration folder. This inconsistent behaviour cab lead to a lot of delay..
I am using turbo repo, i have created a internal package that uses different migration folder for each D1 and persist the files to common directory, both workers and pages depends on it. Please make the changes. Thanks
Additional information
No response
The text was updated successfully, but these errors were encountered: