Chelabase
ManagementData api

The schema the console can show, as the owner or a role

GET
/v1/databases/{id}/branches/{branch_id}/console/schema

What the console may show for one Postgres database of a branch, in the data API schema's shape (schemas, tables with their primary keys and the role's privileges, functions, enums). Without role, everything the database's owner reaches; with it, what that role reaches, after the same check the console's queries pass (it exists and isn't owner-level; BYPASSRLS is allowed, Admin only).

Authorization

bearer
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Database id

Formatuuid
branch_id*string

Branch id

Formatuuid

Query Parameters

database?string

The Postgres database; the branch's main database when absent. It must be served by the data API.

role?string

The role whose view to describe; absent: the database's owner.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/databases/497f6eca-6276-4993-bfeb-53cbbbba6f08/branches/497f6eca-6276-4993-bfeb-53cbbbba6f08/console/schema"
{  "app_users": {    "schema": "string",    "table": "string"  },  "default_schema": "string",  "schemas": {    "property1": {      "enums": {        "property1": [          "string"        ],        "property2": [          "string"        ]      },      "functions": {        "property1": [          {            "args": [              {                "array": true,                "has_default": true,                "name": "string",                "type": "string"              }            ],            "returns": {              "array": true,              "set": true,              "type": "string"            }          }        ],        "property2": [          {            "args": [              {                "array": true,                "has_default": true,                "name": "string",                "type": "string"              }            ],            "returns": {              "array": true,              "set": true,              "type": "string"            }          }        ]      },      "tables": {        "property1": {          "columns": {            "property1": {              "array": true,              "enum": "string",              "generated": true,              "has_default": true,              "nullable": true,              "type": "string"            },            "property2": {              "array": true,              "enum": "string",              "generated": true,              "has_default": true,              "nullable": true,              "type": "string"            }          },          "kind": "table",          "primary_key": [            "string"          ],          "privileges": {            "property1": [              "select"            ],            "property2": [              "select"            ]          },          "rls": true,          "security_invoker": true        },        "property2": {          "columns": {            "property1": {              "array": true,              "enum": "string",              "generated": true,              "has_default": true,              "nullable": true,              "type": "string"            },            "property2": {              "array": true,              "enum": "string",              "generated": true,              "has_default": true,              "nullable": true,              "type": "string"            }          },          "kind": "table",          "primary_key": [            "string"          ],          "privileges": {            "property1": [              "select"            ],            "property2": [              "select"            ]          },          "rls": true,          "security_invoker": true        }      }    },    "property2": {      "enums": {        "property1": [          "string"        ],        "property2": [          "string"        ]      },      "functions": {        "property1": [          {            "args": [              {                "array": true,                "has_default": true,                "name": "string",                "type": "string"              }            ],            "returns": {              "array": true,              "set": true,              "type": "string"            }          }        ],        "property2": [          {            "args": [              {                "array": true,                "has_default": true,                "name": "string",                "type": "string"              }            ],            "returns": {              "array": true,              "set": true,              "type": "string"            }          }        ]      },      "tables": {        "property1": {          "columns": {            "property1": {              "array": true,              "enum": "string",              "generated": true,              "has_default": true,              "nullable": true,              "type": "string"            },            "property2": {              "array": true,              "enum": "string",              "generated": true,              "has_default": true,              "nullable": true,              "type": "string"            }          },          "kind": "table",          "primary_key": [            "string"          ],          "privileges": {            "property1": [              "select"            ],            "property2": [              "select"            ]          },          "rls": true,          "security_invoker": true        },        "property2": {          "columns": {            "property1": {              "array": true,              "enum": "string",              "generated": true,              "has_default": true,              "nullable": true,              "type": "string"            },            "property2": {              "array": true,              "enum": "string",              "generated": true,              "has_default": true,              "nullable": true,              "type": "string"            }          },          "kind": "table",          "primary_key": [            "string"          ],          "privileges": {            "property1": [              "select"            ],            "property2": [              "select"            ]          },          "rls": true,          "security_invoker": true        }      }    }  },  "version": "string"}