N
Neon6mo ago
fascinating-indigo

Is there a Postgres function I can use

Is there a Postgres function I can use to find out what branch I am on and if it is protected?
1 Reply
helpful-purple
helpful-purple6mo ago
We don't have a Postgres function for this, unfortunately. Nice idea, though. The get branch API can tell you if a branch is protected. https://api-docs.neon.tech/reference/getprojectbranch
Neon
Retrieve branch details
Retrieves information about the specified branch. You can obtain a project_id by listing the projects for your Neon account. You can obtain a branch_id by listing the project's branches. A branch_id value has a br- prefix. Each Neon project is initially created with a root and default branch named m...

Did you find this page helpful?