GetBranchSchema
Retrieves the database schema of a Supabase branch.
Operation description
Queries the schema SQL content of a specified database in a specified branch. The system databases postgres, template0, and template1 are not supported.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. This parameter is required when you create a primary branch. When you create a sub-branch, the region of the primary branch is inherited by default. |
cn-beijing |
| ProjectId |
string |
Yes |
The Supabase project ID that corresponds to the primary branch. |
spb-xxxx |
| BranchId |
string |
Yes |
The branch ID that uniquely identifies a Supabase branch. |
br-xxxx |
| DBName |
string |
Yes |
The database name. The system databases postgres, template0, and template1 do not support schema queries. |
neondb |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| RequestId |
string |
The request ID. |
ABB39CC3-4488-4857-905D-2E4A051D**** |
| Sql |
string |
The schema SQL content. |
CREATE TABLE public.example(id int); |
Examples
Success response
JSON format
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D****",
"Sql": "CREATE TABLE public.example(id int);"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.