Chelabase
Data

The schema as the key's role sees it

GET
/data/v1/schema

The tables, views, columns, functions and enums the secret key's role can reach in the database (without privileges), and the databases the key may reach. chelabase gen types reads it.

Authorization

bearer
AuthorizationBearer <token>

A data API key (chk_pub_… or chk_sec_…) as Authorization: Bearer <key>

In: header

Query Parameters

database?string

The Postgres database to describe; the key's main database when left out. It must be served and, when the key has a database list, on it.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/data/v1/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",  "databases": [    "string"  ]}