Connect to db branch from python client

Hello,

I want to use the branching feature to test a db migration (flask-sqlalchemy) before I push to main. I can create a branch from the UI but how can I connect to it? I tried using the connection string and appended /branch_id to the end but from the python client, I got an error that it could not be found. Can someone suggest how to connect to a branch of the db? If there are any github actions examples for creating a branch and applying the migration, I would really appreciate it :slight_smile:

Hi @nabsabraham :

(I am a user)

I have a different “Compute endpoint” and “Connection String” for each branch.

And I have checked my “Dashboard/Connection Details”

  • And every branch has a different “Connection String”

So I have 3 branches - with 3 different “Connections String”.

  • postgres://ImreSamu:pw@ep-floral-firefly-035912.eu-central-1.aws.neon.tech/tr2
  • postgres://ImreSamu:pw@ep-tight-rice-254472.eu-central-1.aws.neon.tech/tr2
  • postgres://ImreSamu:pw@ep-crimson-fog-207560.eu-central-1.aws.neon.tech/tr2
1 Like

oh wow, I missed that! I thought I had to use the same engine and append the branch_id. Thanks so much!!

1 Like

:slight_smile:
You’re not alone in this.
I think they ( Neon.tech ) should make the user interface (UI) clearer for better understanding.

1 Like

We’re in the process of redesigning our console, so this is very valuable feedback! Thank you so much :smile:

1 Like