Serve a Postgres database through the data API
Marks the database enabling and asks the worker to bootstrap it; the answer is 202 at once. Poll the branch's databases for data_api: on, or error with the reason. Pressing it again retries a failed or stuck enable. A database already on answers 200 and nothing runs. The branch serves at most CHELABASE_BRANCH_DATA_API_DATABASE_CAP databases (default 10, main included).
Authorization
bearer In: header
Path Parameters
Database id
uuidBranch id
uuidThe Postgres database's name
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/databases/497f6eca-6276-4993-bfeb-53cbbbba6f08/branches/497f6eca-6276-4993-bfeb-53cbbbba6f08/pg-databases/string/data-api"{ "data_api": "off", "data_api_error": "string", "default_schema": "string", "main": true, "name": "string", "origin": "main", "owner": "string"}Change a Postgres database's default schema PATCH
Stores the schema a data API request to this database uses when it names none. On a served database the bootstrap re-runs for the new schema (so default privileges cover it) before the answer, and the data API picks the change up at once. Objects already in the new schema get the data API grants only with `grant_existing: true`; that flag with an unchanged schema grants on its existing objects now.
Stop serving a Postgres database DELETE
Stops serving the database at once. The `chelabase` schema and the grants stay, so enabling again is instant; `remove=true` also drops the `chelabase` schema and its event trigger (grants to `anon` and `authenticated` stay). Answers 204 after the worker has done it. The branch's main database can't be disabled.