Access a Specific Branch via Database Client
Hello, I'm struggling to see in the neon.tech/docs how to connect to a specific branch from a database client. The connection strings provided all default to the main branch it seems? https://neon.tech/docs/manage/branches#create-a-branch
Neon
Manage branches - Neon Docs
Data resides in a branch. Each Neon project is created with a primary branch called main. You can create child branches from main or from previously created branches. A branch can contain multiple dat...
6 Replies
other-emerald•2y ago
In the console, you can click this dropdown and choose a different branch, the connection string should update to point a different endpoint for that branch

wise-whiteOP•2y ago
Thanks Conrad -- I must have tried 5 times earlier and it wasn't changing the string... but now it is (good news!).
For making changes to the schema (and data, separately) between branches and then merging them again... what are the most common pathways your users are using for git controls of these changes?
genetic-orange•2y ago
The general flow for managing schema changes is via CI in GitHub.
For example, develop in
dev Git branch and a corresponding Neon branch. You can test schema changes work before merging into the Git main branch. Upon merge you can apply new schema changes to you Neon main/primary using CI.wise-whiteOP•2y ago
Thanks @ShinyPokemon -- yes, that's what we were thinking/wanting. Is there a way to use just Neon (and github) to do this, without needing additional third party tools?
genetic-orange•2y ago
You'll need to use
psql or an ORM or similar tool in your GitHub Workflow to apply the migration files.wise-whiteOP•2y ago
yeah, using liquibase for this