Is there a way I can setup neon branch like setup with local DB
Every developer in our team has a dedicated branch to use for local development. However, I live quite far away from where the database is hosted, which makes local development pretty slow.
Is there anything I could do to overcome not using neon branches?
With the neon branch I only need a single neon branch, I can reset it easily whenever I want to switch git branches (eg when this is needed: migration is applied in the old branch, whose migration file would be missing in the new branch )
When using the local database, I would have to reset the database to apply migrations and sync.
Has anyone built a tool that would do what Neon does but for local DBs? If, not I would like to get feedback on how to go about it so that I can build it myself.
The summary of this tool would be
- branch checkout command: 1) does git checkout 2) Creates a local DB 3) changes DATABASE_URL in .env file. So anytime, I go back to the previous branch. I can continue from where I left off. This will help in not getting into migration drifts etc
- Replicate "Reset from main": Using neon main branch URL and performing pg dump and restore. Optionally providing a path to a recent dump file to save time.
- Replicate "Reset from main": Using neon main branch URL and performing pg dump and restore. Optionally providing a path to a recent dump file to save time.
0 Replies