/v1/databases/{uid}/data/tablesLists the tables and views in a PostgreSQL or MySQL database, for use with Browse table rows. Redis databases have no tables; use List keys instead.
- PostgreSQL: tables, partitioned tables, views, materialized views and foreign tables
in every schema except the system schemas, limited to those the database user can
SELECT. Partitions are left out. Tables inpubliccome first. - MySQL: tables and views in every schema except
mysql,information_schema,performance_schemaandsys. Tables in the database's own schema come first. - At most 2000 entries are returned.
The database must be ready. Data browser calls share a small platform-wide pool of
connections; when it is full you get 409 and should retry shortly. Requires the
secrets read permission (owner, admin or developer role).
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe database's uid.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Response
The tables and views.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataarray of objectsShow item attributesHide item attributes
schemastringRequiredSchema (PostgreSQL) or database (MySQL) the table belongs to.
namestringRequiredTable or view name.
kindstringRequiredPostgreSQL: table, partitioned_table, view, materialized_view or foreign_table. MySQL: table, view, or the lower-case table type for anything else.
estimated_rowsinteger | nullRequiredApproximate row count from the engine's statistics. null for views and for PostgreSQL tables that have not been analyzed yet.
Errors
| Status | Meaning |
|---|---|
400 | The request failed. Possible messages: this database has no tables, browse its keys instead (Redis), the data viewer doesn't support this database engine, the database rejected the connection: <reason>, or an error from the database. |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | The resource does not exist or you cannot access it. |
409 | The data browser cannot run right now. Possible messages: the database must be ready to browse its data, the data viewer is busy, try again in a moment, and couldn't reach the database, check that it's running and try again. |
Errors use the standard error format.