Database

Exposing tables

A table is private until you expose it. Select, insert, update, and delete are separate switches, and each one maps to a real PostgreSQL grant.

One switch per operation

customers · exposure illustration

Served at /rest/v1/customers for the operations you switched on.

Illustration. Toggles here do not change any real table.
SwitchHTTPPostgreSQL grant to the API role
selectGET /rest/v1/{table}GRANT SELECT
insertPOST /rest/v1/{table}GRANT INSERT
updatePATCH /rest/v1/{table}/{id}GRANT UPDATE
deleteDELETE /rest/v1/{table}/{id}GRANT DELETE

Turning a switch off revokes the grant immediately. A request for an operation that is not exposed returns 405 method_not_allowed.

Choosing what to expose

  • Start with select only, and add write operations when a screen needs them.
  • A shared catalog might expose select to everyone; a per-user table pairs writes with a user column.
  • Exposure is not authorization by itself: every request still needs a publishable key and an end-user JWT.
  • The Console row browser is unaffected — it uses the SQL role, not the API role.

Additional resources