N
Neon2y ago
wise-white

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
other-emerald2y 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
No description
wise-white
wise-whiteOP2y 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
genetic-orange2y 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-white
wise-whiteOP2y 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
genetic-orange2y ago
You'll need to use psql or an ORM or similar tool in your GitHub Workflow to apply the migration files.
wise-white
wise-whiteOP2y ago
yeah, using liquibase for this

Did you find this page helpful?