Sharing DB between developers
I want to share the DB with my mate so everything that we both do in solo dev environments(each one on his local host) pushes to the same base/tables
3 Replies
Hi @ckobasti, why do you want to share the same DB? Is it that you want to see the same data on both dev deployments?
You could do a couple things:
1. Download a snapshot of the data from your Convex dashboard https://docs.convex.dev/database/import-export/export, then import it on the other dev deployment
2. Write yourself an internal action that reads the data from the database and sends it over to the other deployment
We don't have a built-in way to share the DB between multiple deployments.
If you want to share the whole backend (both data and code), for example if one of you works on a frontend only, and another one on the backend, you can share your CONVEX_URL (or VITE_CONVEX_URL etc.) for the dev deployment and the frontend developer can use that in their
.env.local
Will that enable us to test our friend requests and messages in the app?
For testing you have a couple options:
1. Push it to the production deployment and publish it with vercel or similar, then share the site with anyone to test. You both share this prod deployment so deploying will overwrite code but data will stay.
2. You can point your website at your friend’s backend by putting in their convex url when configuring the convex client. You wouldn’t sync functions, you would just have the frontend talking to the other’s backend. If one of you is focusing on frontend only this would let you move quickly.
Testing UI development against the prod backend also works, if you want to have data around to test with. However you’ll probably soon benefit from making a “seed” script and use it to make test/dummy data